5 Replies Latest reply on Feb 3, 2010 2:26 PM by csimons

    ExtendedDataTable: Group by is not working correctly

    csimons

      All -

       

      I'm experiencing an issue with the ExtendedDataTable component; when I select a column to group by, it's only grouping by the first row.  Even if the rows/values fall under a different group, everything is being put under the one and only one group.  See screenshot below.RF_EDT_Issue.png

       

      The only issue I can think of (this is my first time using the ExtendedDataTable), is that the DataModel is not of the correct class.

       

      Here is how I am getting the DataModel which is bound to the table above.  Can anyone see what the issue might be?

       

      public DataModel fetchPositions(Long paragraphId)
          {
              List<ResponsePosition> positions;


              positions = entityManager.createQuery("select rpos from ResponsePosition rpos, ResponseParagraph rp " +
                      "where rp.id =:pResponseParagraphId " +
                      "and rpos.responseParagraph.id = rp.id " +
                      "order by rpos.positionLineNum")
                      .setParameter("pResponseParagraphId", paragraphId)
                      .getResultList();

              DataModel positionsModel = new ListDataModel(positions);


              return positionsModel;

             
             
          }

        • 1. Re: ExtendedDataTable: Group by is not working correctly
          ilya_shaikovsky
          show please also page code.
          • 2. Re: ExtendedDataTable: Group by is not working correctly
            csimons

            Ilya,

             

            Sure thing, here is a snippet.  Let me know if you need more.  Thanks for taking a look.

             

            <!-- _responseParagraph is the higher-level iterated object -->

            <rich:extendedDataTable id="positionsTest"
                                        value="#{responseManager.fetchPositions(_responseParagraph.id)}"
                                        var="_position"
                                        rowClasses="#{dataTableBean.rowClasses}">
                                    <f:facet name="header">
                                         <rich:columnGroup>
                                            <rich:column colspan="2">
                                                <h:outputText value="#{_responseParagraph.paraNumber} - #{_responseParagraph.paraName} [Location: #{_responseParagraph.location}]"/>
                                            </rich:column>
                                            <rich:column colspan="1">
                                                <h:commandLink action="#{responseManager.viewParagraph(_responseParagraph)}"
                                                        value=">> View Details">
                                                </h:commandLink>
                                             </rich:column>
                                            <rich:column colspan="2">
                                                <div class="buttons" align="right">
                                                </div>
                                            </rich:column>
                                        </rich:columnGroup>
                                    </f:facet>
                                    <rich:column label="Line #">
                                        <f:facet name="header"><h:outputText value="Line #"/></f:facet>
                                        <h:outputText value="#{_position.positionLineNum}"/>
                                    </rich:column>
                                    <rich:column sortBy="#{_responsePosition.posName}" label="Position Name">
                                        <f:facet name="header">Position Name</f:facet>
                                        <h:outputText value="#{_position.posName}"/>
                                    </rich:column>
                                    <rich:column sortBy="#{_responsePosition.dutyDescription.fullDutyDescription}" label="Duty Description">
                                        <f:facet name="header">Duty Description</f:facet>
                                        <h:outputText value="#{_position.dutyDescription.fullDutyDescription}"/>
                                    </rich:column>
                                    <rich:column>
                                        <f:facet name="header">
                                            <h:outputText value="Actions"/>
                                        </f:facet>
                                    </rich:column>

             

                                </rich:extendedDataTable>

            • 3. Re: ExtendedDataTable: Group by is not working correctly
              csimons
              I am still unable to get grouping to work...even when I specify the column to group using "groupingColumn".
              • 4. Re: ExtendedDataTable: Group by is not working correctly
                ilya_shaikovsky

                you have                      

                                         <rich:column sortBy="#{_responsePosition.posName}" label="Position Name">
                                            <f:facet name="header">Position Name</f:facet>
                                            <h:outputText value="#{_position.posName}"/>
                                        </rich:column>
                                        <rich:column sortBy="#{_responsePosition.dutyDescription.fullDutyDescription}" label="Duty Description">
                                            <f:facet name="header">Duty Description</f:facet>
                                            <h:outputText value="#{_position.dutyDescription.fullDutyDescription}"/>
                                        </rich:column>

                but it seems should be

                 

                                        <rich:column sortBy="#{_position.posName}" label="Position Name">
                                            <f:facet name="header">Position Name</f:facet>
                                            <h:outputText value="#{_position.posName}"/>
                                        </rich:column>
                                        <rich:column sortBy="#{_position.dutyDescription.fullDutyDescription}"" label="Duty Description">
                                            <f:facet name="header">Duty Description</f:facet>
                                            <h:outputText value="#{_position.dutyDescription.fullDutyDescription}"/>
                                        </rich:column>
                • 5. Re: ExtendedDataTable: Group by is not working correctly
                  csimons
                  I'm sorry, I really should have caught that.  Thanks for pointing that out to me - it works now.