4 Replies Latest reply on Apr 20, 2007 6:09 PM by tony.herstell1

    s:fragment in dataTable

    tony.herstell1

      given :

      <h:dataTable var="eachDisplayableCategory"
       value="#{displayableCategorySet}"
       rendered="#{displayableCategorySet.rowCount>0}">
      
      <h:column>
      <f:facet name="header">
       <h:outputText value="#{messages.category_name}" />
      </f:facet>
      <h:outputText value="Head: #{eachDisplayableCategory.head} - " />
      <h:outputText value="Displayed: #{eachDisplayableCategory.displayed} - " />
      <h:outputText value="Selected: #{eachDisplayableCategory.selected} - " />
      <h:outputText value="Parenting: #{eachDisplayableCategory.parenting} - " />
      <h:outputText value="Refined: #{eachDisplayableCategory.refined} - "/>
      <h:outputText value="Name: #{eachDisplayableCategory.immutableCategory.nameKey}"/>
      </h:column>
      
       <s:fragment rendered="#{eachDisplayableCategory.displayed}">
      
       <h:column>
      


      The last fragment, that comes before a <h:column> causes the <h:column> to not be rendered in a dataTable. IS THIS A BUG?

      Also.. it appears that not providing a <h:column> at all; causes no text to be display (This one I can appreciate - even though it took hours to find it!).. a useful message from JSF saying NO Columns would have been nice!



        • 1. Re: s:fragment in dataTable
          pmuir

          h:column must be a direct child of h:dataTable

          • 2. Re: s:fragment in dataTable
            tony.herstell1

            Could this be added to the manual?
            I put fragemnts round a LOT of stuff... and this is hell of a gotcha as there is NO clue why stuff just aint appearing!
            JSF kindly dont put out any mesasges...

            • 3. Re: s:fragment in dataTable
              pmuir

              Not really, this is just JSF ;) Better errors/warnings for this kind of thing are on the cards for JSF 2.

              • 4. Re: s:fragment in dataTable
                tony.herstell1

                Well I hope that this post helps someone who got as frustrated as myself.

                tis like second nature to do this:

                 <h:column>
                 <s:fragment rendered="#{eachDisplayableCategory.refined}">
                 <s:fragment
                 rendered="#{eachDisplayableCategory.immutableCategory.parent == null}">
                 <h:selectBooleanCheckbox
                 value="#{eachDisplayableCategory.selected}" disabled="true" />
                 </s:fragment>
                 <s:fragment
                 rendered="#{eachDisplayableCategory.immutableCategory.parent != null}">
                 <h:selectBooleanCheckbox
                 value="#{eachDisplayableCategory.selected}" />
                 </s:fragment>
                 </s:fragment>
                 <s:fragment rendered="#{eachDisplayableCategory.refined}">
                 <h:selectBooleanCheckbox
                 value="#{eachDisplayableCategory.selected}" disabled="true" />
                 </s:fragment>
                 </h:column>
                


                its only a small set to add <s:fragment> outside the column!!! and you have NO IDEA why suddenly nothing happens...

                :/