ICEfaces
  1. ICEfaces
  2. ICE-10147

ace:tooltip - Add the capability to dynamically render a tooltip when used with a dataTable

    Details

      Description

      The use case is that an ace:tooltip is used with an ace:dataTable in conjunction with the ace:delegate. The requirement is to dynamically determine if the tooltip should be shown on a row by row basis, through a row level flag/object.

      Currently the only way to do this is by including the tooltip into the ace:column object. This goes against our performance best practices for using tooltips and dataTables. Having the tooltip markup in the table causes the table markup to be much larger.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Assigning to Ken to delegate for the next EE release.

        Show
        Deryk Sinotte added a comment - Assigning to Ken to delegate for the next EE release.
        Hide
        Arturo Zambrano added a comment -

        I tried to find a solution with the current state of the ace:tooltip component, but there's no way to achieve this at the moment. While a display listener is supported, which is triggered before the tooltip is displayed, there's just no way to prevent the tooltip from showing once it has been triggered.

        Among all the different ways to support this capability, I think the following two ways are the most appropriate.

        1. Add a 'disabled' attribute. This attribute would be updated dynamically by rendering a script tag solely dedicated to this setting. This attribute would be read from within the callback function that is executed when the request to the server is successful. So, if 'disabled' is set to true in the display listener, this setting will be updated in the client before the tooltip is displayed. The only disadvantage is that the app developer would have to manage the state of this setting and to make sure to set it back to true in the display listener when the tooltip is meant to be displayed.

        2. Add a new TooltipDisplayEvent object which will be passed to the ace:tooltip displayListener and will support the method 'cancelDisplay()'. In this case, the app developer would simply have to invoke cancelDisplay() on the event object and not worry about handling state, since the cancellation would only be applicable to the current display event. In the client side, things would work similarly as the scenario described in the previous approach; the component itself would just take care of handling the state of the 'disabled' setting. The disadvantage of this approach is that it might break compatibility, since the current displayListener doesn't support any event object, so all apps currently using it would have to be updated to support this new event object.

        Show
        Arturo Zambrano added a comment - I tried to find a solution with the current state of the ace:tooltip component, but there's no way to achieve this at the moment. While a display listener is supported, which is triggered before the tooltip is displayed, there's just no way to prevent the tooltip from showing once it has been triggered. Among all the different ways to support this capability, I think the following two ways are the most appropriate. 1. Add a 'disabled' attribute. This attribute would be updated dynamically by rendering a script tag solely dedicated to this setting. This attribute would be read from within the callback function that is executed when the request to the server is successful. So, if 'disabled' is set to true in the display listener, this setting will be updated in the client before the tooltip is displayed. The only disadvantage is that the app developer would have to manage the state of this setting and to make sure to set it back to true in the display listener when the tooltip is meant to be displayed. 2. Add a new TooltipDisplayEvent object which will be passed to the ace:tooltip displayListener and will support the method 'cancelDisplay()'. In this case, the app developer would simply have to invoke cancelDisplay() on the event object and not worry about handling state, since the cancellation would only be applicable to the current display event. In the client side, things would work similarly as the scenario described in the previous approach; the component itself would just take care of handling the state of the 'disabled' setting. The disadvantage of this approach is that it might break compatibility, since the current displayListener doesn't support any event object, so all apps currently using it would have to be updated to support this new event object.
        Hide
        Arturo Zambrano added a comment -

        Committed improvement to 3.3 EE maintenance branch at revision 43835 and to 4.0 trunk at revision 43836.

        Added 'delegateDisplayListener' attribute to ace:tooltip, which works like displayListener, but takes an argument of type TooltipDelegateDisplayEvent. This event object has a cancelDisplay() method that can be invoked to prevent the tooltip from being displayed.

        The listener would look similar to the following method:

        	public void listener(org.icefaces.ace.event.TooltipDelegateDisplayEvent event) {
        		event.cancelDisplay();
        	}
        

        In the xhtml document, the attribute would look like delegateDisplayListener="#

        {bean.listener}

        " .

        Show
        Arturo Zambrano added a comment - Committed improvement to 3.3 EE maintenance branch at revision 43835 and to 4.0 trunk at revision 43836. Added 'delegateDisplayListener' attribute to ace:tooltip, which works like displayListener, but takes an argument of type TooltipDelegateDisplayEvent. This event object has a cancelDisplay() method that can be invoked to prevent the tooltip from being displayed. The listener would look similar to the following method: public void listener(org.icefaces.ace.event.TooltipDelegateDisplayEvent event) { event.cancelDisplay(); } In the xhtml document, the attribute would look like delegateDisplayListener="# {bean.listener} " .
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces 4 trunk and ee-3.3.0 maintenance branch r43866. Tomcat 7, IE 11, FF 34, Chrome 39.
        Created new QA test applications /tooltipICE-10147.jsf
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/tooltip
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/tooltip

        Show
        Liana Munroe added a comment - Verified ICEfaces 4 trunk and ee-3.3.0 maintenance branch r43866. Tomcat 7, IE 11, FF 34, Chrome 39. Created new QA test applications /tooltipICE-10147.jsf http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/tooltip http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/tooltip
        Hide
        Liana Munroe added a comment -

        Verified ace:tooltip delegate demo modified in showcase. ICEfaces 4.1.1 Jenkins build 2. Tomcat 8, FF 43, Chrome 47, IE 11, 10, 9, 8.

        Show
        Liana Munroe added a comment - Verified ace:tooltip delegate demo modified in showcase. ICEfaces 4.1.1 Jenkins build 2. Tomcat 8, FF 43, Chrome 47, IE 11, 10, 9, 8.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: