ICEfaces
  1. ICEfaces
  2. ICE-6370

ice:datatable not working inside ui:repeat

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Windows XP, Glassfish 2.1.1

      Description

      In latest Icefaces2 beta, when trying to render a list of datatables, only the last one is displayed.

      This seems like a bug.

      Using c:forEach works "fine", except it is not the right thing to use and a modification of the c:forEach source collection will not be reflected after first page view.

      Anyone knowing how to solve that, or is there a workaround?

      Yannick

      Code:

                               <ui:repeat value="#{GestionDecharges.coursSelTravCollection}" var="ligneActivite" >
       
                                           <ice:dataTable value="#{ligneActivite.ligneAttributionsAnneeN}"
                                                        var="attributionAnneeN">
                                               <ice:column >
                                                   <f:facet name="header">
                                                       <h:outputLabel value="Nom" style="width: 150px" />
                                                   </f:facet>
                                                   <h:commandButton value="#{attributionAnneeN.nomEnseignant}" action="#{GestionDecharges.afficherVueProf(attribution.intervenant,GestionDecharges.anacAttributionDisplay)}" styleClass="lien" />
                                               </ice:column>
                                               <ice:column >
                                                   <f:facet name="header" >
                                                       <h:outputLabel value="Prénom" style="width: 150px"/>
                                                   </f:facet>
                                                   <h:outputText value="#{attributionAnneeN.prenomEnseignant}" style="width: 150px"/>
                                               </ice:column>
                                           </ice:dataTable>
       
                               </ui:repeat>

        Issue Links

          Activity

          Yannick Majoros created issue -
          Ken Fyten made changes -
          Field Original Value New Value
          Link This issue duplicates ICE-6313 [ ICE-6313 ]
          Ken Fyten made changes -
          Assignee Judy Guglielmin [ judy.guglielmin ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 2.0.0 [ 10230 ]
          Assignee Priority P1
          Ken Fyten made changes -
          Link This issue duplicates ICE-6313 [ ICE-6313 ]
          Ken Fyten made changes -
          Link This issue is duplicated by ICE-6361 [ ICE-6361 ]
          Ken Fyten made changes -
          Assignee Judy Guglielmin [ judy.guglielmin ] Ted Goddard [ ted.goddard ]
          Hide
          Ted Goddard added a comment -

          Testing with h:dataTable shows slightly better behavior: the tables render. However, the behavior is still ultimately flawed since the dataTable components are all assigned the same ID. In the case of ice:dataTable using the compat API DOMContext, duplicate IDs result in DOMContext re-use, causing the component to render on top of itself. JSF will need to be fixed so that ui:repeat behaves as a proper iterative naming container. If this is not implemented in JSF, ICEfaces can provide an ice:repeat that works correctly as an iterative naming container.

          This will remain a known issue for ICEfaces 2.0, but an enhanced ice:repeat could be provided upon request to product.support@icesoft.com.

          Show
          Ted Goddard added a comment - Testing with h:dataTable shows slightly better behavior: the tables render. However, the behavior is still ultimately flawed since the dataTable components are all assigned the same ID. In the case of ice:dataTable using the compat API DOMContext, duplicate IDs result in DOMContext re-use, causing the component to render on top of itself. JSF will need to be fixed so that ui:repeat behaves as a proper iterative naming container. If this is not implemented in JSF, ICEfaces can provide an ice:repeat that works correctly as an iterative naming container. This will remain a known issue for ICEfaces 2.0, but an enhanced ice:repeat could be provided upon request to product.support@icesoft.com.
          Hide
          Yannick Majoros added a comment -

          ok, but h:dataTable works in ui:repeat, right? I mean, this is an Icefaces problem, or is it mojarra?

          Show
          Yannick Majoros added a comment - ok, but h:dataTable works in ui:repeat, right? I mean, this is an Icefaces problem, or is it mojarra?
          Hide
          Ted Goddard added a comment -

          Same problem with Mojarra 2.1.0 (SNAPSHOT b09).

          Show
          Ted Goddard added a comment - Same problem with Mojarra 2.1.0 (SNAPSHOT b09).
          Hide
          Ted Goddard added a comment -

          So the question is: is this a mojarra bug or an ICEfaces bug? This is a mojarra bug, since the mojarra datatable renders, but each instance is given the same ID. This means that the page produces visible output, but it would quickly become corrupted as soon as an Ajax update was attempted.

          ICEfaces relies on unique IDs during rendering, so shows symptoms sooner.

          It may be possible as a workaround to dynamically assign the id on the dataTable where the items in the iteration return a unique ID:

          <ice:dataTable id="#

          {repeatVar.id}

          ">

          Show
          Ted Goddard added a comment - So the question is: is this a mojarra bug or an ICEfaces bug? This is a mojarra bug, since the mojarra datatable renders, but each instance is given the same ID. This means that the page produces visible output, but it would quickly become corrupted as soon as an Ajax update was attempted. ICEfaces relies on unique IDs during rendering, so shows symptoms sooner. It may be possible as a workaround to dynamically assign the id on the dataTable where the items in the iteration return a unique ID: <ice:dataTable id="# {repeatVar.id} ">
          Hide
          Yannick Majoros added a comment -

          Thanks.

          Is there a bug report in mojarra's bug tracker?

          I'll try the workaround and get back soon.

          Show
          Yannick Majoros added a comment - Thanks. Is there a bug report in mojarra's bug tracker? I'll try the workaround and get back soon.
          Hide
          Ted Goddard added a comment -

          We have not had a chance yet to create the mojarra bug report. Please do so if it's convenient and include the link here.

          Show
          Ted Goddard added a comment - We have not had a chance yet to create the mojarra bug report. Please do so if it's convenient and include the link here.
          Hide
          Yannick Majoros added a comment -

          I could find those existing bug reports:

          http://java.net/jira/browse/JAVASERVERFACES-1830
          http://java.net/jira/browse/JAVASERVERFACES-1834

          I think the first one is just what you are explaining. Could you confirm this? The second one gives us a hint of a workaround.

          Interesting discussion: http://stackoverflow.com/questions/3882147/how-to-refer-to-datatable-parent-within-the-datatable

          Regards,

          Yannick Majoros

          Show
          Yannick Majoros added a comment - I could find those existing bug reports: http://java.net/jira/browse/JAVASERVERFACES-1830 http://java.net/jira/browse/JAVASERVERFACES-1834 I think the first one is just what you are explaining. Could you confirm this? The second one gives us a hint of a workaround. Interesting discussion: http://stackoverflow.com/questions/3882147/how-to-refer-to-datatable-parent-within-the-datatable Regards, Yannick Majoros
          Hide
          Ken Fyten added a comment -

          This will need Mojarra JSF 2.1 as it's a JSF bug.

          Show
          Ken Fyten added a comment - This will need Mojarra JSF 2.1 as it's a JSF bug.
          Ken Fyten made changes -
          Fix Version/s 2.1 [ 10241 ]
          Fix Version/s 2.0.0 [ 10230 ]
          Hide
          Ted Goddard added a comment -

          From the java.net bugs, it looks like the mojarra team is aware of the problem. ICEfaces could provide a fix, however, as a new component that functions like h:dataTable but does not introduce the <table> markup. Please contact product.support@icesoft.com if you wish to request a new component for this.

          Show
          Ted Goddard added a comment - From the java.net bugs, it looks like the mojarra team is aware of the problem. ICEfaces could provide a fix, however, as a new component that functions like h:dataTable but does not introduce the <table> markup. Please contact product.support@icesoft.com if you wish to request a new component for this.
          Hide
          Ted Goddard added a comment -

          This is not an ICEfaces bug, but could be resolved with a new ICEfaces component with the desired behavior.

          Show
          Ted Goddard added a comment - This is not an ICEfaces bug, but could be resolved with a new ICEfaces component with the desired behavior.
          Ted Goddard made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 2.0.0 [ 10230 ]
          Fix Version/s 2.1 [ 10241 ]
          Assignee Priority P1
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Ted Goddard
              Reporter:
              Yannick Majoros
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: