ICEfaces
  1. ICEfaces
  2. ICE-7308

event.getContextValue returns a String object

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-2.0.0.GA
    • Fix Version/s: 3.0.RC1, 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Icefaces 2.0 EE, Tomcat 7
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      XHTML:
      <ice:dataTable var="user" value="#{bean.listWithUsers}">

      <ice:column>
      <f:facet name="header">
      <ice:outputText value="ID" />
      </f:facet>
      <ice:panelGroup id="panelGroup" panelTooltip=":::panelToolTip">
      <ice:inputHidden value="#{user}"/>
      <ice:outputText id="id" value="#{user.id}"/>
      </ice:panelGroup>
      </ice:column>
      ....
      </ice:dataTable>
      ....
      <ice:panelTooltip id="panelToolTip"
      displayListener="#{bean.displayListener}">
      <f:facet name="header">
      <ice:outputText value="User Data:"/>
      </f:facet>

      <f:facet name="body">
      <ice:outputText value="#{bean.message}"/>
      </f:facet>
      </ice:panelTooltip>

      Java:
      public void displayListener(DisplayEvent event)
      {
      if (event.isVisible())
      {
      UIComponent component = event.getTarget();
      List<UIComponent> kids = component.getChildren();
      HtmlInputHidden hidenInput = (HtmlInputHidden)kids.get(0);
      User value = (User)hidenInput.getValue();
      message = "This is a user: " + value.getFirstName()+" with ID#"+value.getId();
      }
      }
      Show
      XHTML: <ice:dataTable var="user" value="#{bean.listWithUsers}"> <ice:column> <f:facet name="header"> <ice:outputText value="ID" /> </f:facet> <ice:panelGroup id="panelGroup" panelTooltip=":::panelToolTip"> <ice:inputHidden value="#{user}"/> <ice:outputText id="id" value="#{user.id}"/> </ice:panelGroup> </ice:column> .... </ice:dataTable> .... <ice:panelTooltip id="panelToolTip" displayListener="#{bean.displayListener}"> <f:facet name="header"> <ice:outputText value="User Data:"/> </f:facet> <f:facet name="body"> <ice:outputText value="#{bean.message}"/> </f:facet> </ice:panelTooltip> Java: public void displayListener(DisplayEvent event) { if (event.isVisible()) { UIComponent component = event.getTarget(); List<UIComponent> kids = component.getChildren(); HtmlInputHidden hidenInput = (HtmlInputHidden)kids.get(0); User value = (User)hidenInput.getValue(); message = "This is a user: " + value.getFirstName()+" with ID#"+value.getId(); } }

      Description

      I have the following in my xhtml:

      <ice:dataTable value="#{orderdia.newTableBlock}"
      var="lineItems"
      columnClasses="tableCol"
      rows="5"
      id="OrderDia_newTableBlock">

      <ice:column >
      <f:facet name="header">
      <ice:outputText value="column_title" />
      </f:facet>
      <ice:panelGroup panelTooltip=":iceform:_pw_OrderDia_popupTwo" contextValue="#{lineItems}">
      <ice:outputText id="OrderDia_record_title_column" value="#{lineItems.record_title}" >
      </ice:outputText>
      </ice:panelGroup>
      </ice:column>

      The #{lineItems} expression used to be of type ListRow in version 1.8.2.

      This is my displayListener for the panelTooltip:

      public void popupTwo_Display(DisplayEvent event) {
      ListRow listRow = event.getContextValue();

      This worked fine in 1.8.2. In version 2 it fails with a ClassCastException, as the getContextValue() method always returns an object of type String.

        Issue Links

          Activity

          Hide
          Evgheni Sadovoi added a comment -

          The issue resolved in ICE-5351 for ICEfaces 1.8 reappeared in 2.0

          Show
          Evgheni Sadovoi added a comment - The issue resolved in ICE-5351 for ICEfaces 1.8 reappeared in 2.0
          Hide
          Mark Collette added a comment -

          I haven't tested this, beyond compiling, but the code change in the ICEfaces 1.8 code was so trivial that I simply replicated it in the ICEfaces 2 codebase. QA should be able to grab the regression test from ICE-5351 and use that too.

          Subversion 26339
          icefaces2/compat/components/src/main/java/com/icesoft/faces/component/paneltooltip/PanelTooltip.java

          Show
          Mark Collette added a comment - I haven't tested this, beyond compiling, but the code change in the ICEfaces 1.8 code was so trivial that I simply replicated it in the ICEfaces 2 codebase. QA should be able to grab the regression test from ICE-5351 and use that too. Subversion 26339 icefaces2/compat/components/src/main/java/com/icesoft/faces/component/paneltooltip/PanelTooltip.java

            People

            • Assignee:
              Mark Collette
              Reporter:
              Evgheni Sadovoi
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: