4 Replies Latest reply on Nov 9, 2009 10:31 AM by Luk Tybul

    rich:componentControl and rich:toolTip

    Marcin Bednarek Newbie

      When I'm using rich:componentControl with rich:contextMenu like it is in documentation everything works ok. Params {car} and {model} are converted to proper values, for example {model} = Ford

      <rich:contextMenu attached="false" id="menu" submitMode="ajax">
       <rich:menuItem ajaxSingle="true">
       <b>{car} {model}</b> details
      <rich:componentControl event="onRowClick" for="menu" operation="show">
       <f:param value="#{car.model}" name="model"/>
       <f:param value="#{car.make}" name="car"/>

      But when I'm trying to use rich:componentControl with rich:toolTip params in brackets are not converted to proper values. {model} = {model}. It is a bug?

      <rich:toolTip id="menu" direction="bottom-right" layout="block" zorder="2" hideDelay="0" value="{model}"/>

        • 2. Re: rich:componentControl and rich:toolTip
          Ilya Shaikovsky Master

          seems ToolTip doesn't supports such substitutions. Please put an RFC to our jira.

          • 4. Re: rich:componentControl and rich:toolTip
            Luk Tybul Newbie

            Hi, I think I have found a workaround since I have bumped on same problem.

            Im using current release of RF 3.3.2.SR1, so my solution is related to this version.

            Its true that rich:tooltip doesnt resolve parameters provided via rich:control in a param attribute or f:param. In order to show a tooltip for a whole row, You have to capture onRowMouseOver of dataTable and then show the tooltip manually. But instead placing rich:toolTip outside the dataTable, You need to nest it inside a table, and define whole view of tooltip in it. During creating view, separate tooltip with separate id will be created for each row, and all we need to do is to show it (by calling "show" method of its component). Making tooltips per row might be a drawback but You dont have to make an ajax call, each time row is changed, because all data is generated on client side. Until tooltip parametrisation is fixed this is a cheap but working solution. Take a look at code below:

            <rich:dataTable id="issueItems" var="issue" value=#{issueList.list}>
            (..several columns definition)
            <f:facet name="header">
            issue type
            <h:outputTest value="#{issue.issueType}"/>

            <!-- here comes tooltip definition, remember to provide its id !!! -->
            <!-- for convention sake, its not attached to column, because we need it per row -->

            <rich:tooltip id="rowTooltip" attached="false">
            <h1>Issue details</h1>
            <h:output:Text value=#{issue.descritpion}>

            <!-- here comes control for tooltip, note that it captures onRowMouseOver/Out actions -->

            <rich:componentControl event="onRowMouseOver" for="rowTooltip" operation="show"/>
            <rich:componentControl event="onRowMouseOut" for="rowTooltip" operation="hide"/>


            You HAVE to provide onRowMouseOut control to close tooltip when user leaves active row. Either way tooltip will be shown.

            remember to define id for tooltip, during restore view phase, it will get a client id something like: form_name:3: rowTooltip where the number in the middle will represent selected row. Checkout page source and You will se what has been really generated.

            Hopefully this will help someone. Im also intrested when this issue will be solved, because providin a parameres in componentControl would be very convinient.

            Example below should