0 Replies Latest reply on Nov 11, 2007 8:39 PM by Bob Brown

    BUG: EL expansion generates varying values

    Bob Brown Newbie

      I have a strange bug.

      The following code is in a file that is included via <ui:include> into a tab, which is part of a tabPanel.

       <a4j:region>
       <h:selectOneListbox
       value="#{selectedSeries.parameters.component}"
       id="#{selectedSeries.uniqueID}components" size="16"
       required="true">
       <f:selectItems
       value="#{selectedSeries.parameters.componentList}" />
       <a4j:support event="onchange"
       action="#{logDHalfHourlyAnalogController.componentsAction}"
       reRender="#{selectedSeries.uniqueID}stat">
       <f:param name="uniqueID"
       value="#{selectedSeries.uniqueID}" />
       </a4j:support>
       </h:selectOneListbox>
       </a4j:region>
      


      I am creating and removing tabs.

      Each time a tab is removed the WHOLE tabPanel is recreated
      (by an AJAX refresh of the enclosing
      <h:panelGroup>) from the underlying data model.

      Removal of a tab and subsequent recreation of the tabPanel results in
      what looks like a bug.

      Take a look at the HTML generated from the above JSF fragment:

      <SELECT id="j_id1:parameters0:SelectedSeries41987318917418components"
       onchange="A4J.AJAX.Submit('j_id1:parameters0:j_id55','j_id1',event,{'parameters':{'uniqueID':'SelectedSeries42053252859930','j_id1:parameters0:j_id57':'j_id1:parameters0:j_id57'} ,'actionUrl':'/ULS/jsf/main.faces'} )"
       size="16"
       name="j_id1:parameters0:SelectedSeries41987318917418components">
      OPTION value="cst-bhx.1042a.amps">cst-bhx.1042a.amps</OPTION>
      <OPTION value="cst-bhx.1042a.volts">cst-bhx.1042a.volts</OPTION>
      </SELECT>
      


      The JSF consistently uses the expression "#{selectedSeries.uniqueID}" in its
      IDs.

      BUT note how this SINGLE expression is expanded into different values.

      In fact, in this case, "SelectedSeries41987318917418components" is correct
      but the 'uniqueID' parameter value "SelectedSeries42053252859930" is wrong--it is the value associated with the data structure whose removal is causing the
      refresh of the tabPanel.

      I have confirmed that the data structure IS removed from the underlying model
      and CANNOT be found prior to the refresh of the tabPanel.

      In any case, the single expression should not expand to two values...

      I am using a uniqueID because it seems necessary to ensure that IDs
      are GLOBALLY unique across all
      tabs, not just the displayed one. This surprised me, since I am using
      AJAX mode but never mind.

      My stack initially was Richfaces 3.1.2GA with the JSF implementation shipped
      with JBoss 4.2.2.

      I tried upgrading things, so I am now using:
      - richfaces 3.1.2GA
      - JSF-RI 1.2_05-b06FCS
      - facelets 1.0.14

      I see no differences in effect between the various toolchains.

      This is a show-stopper for me at the moment, so I'd really love to hear if anyone has any workarounds!

      Cheers,

      Alph