8 Replies Latest reply on May 17, 2007 6:38 AM by ilya_shaikovsky

    How to have sortable column?

      Is there any rich tag to have a sortable column within rich:dataTable? Is there anything equivalent to t:commandSortHeader in tomahawk?

        • 1. Re: How to have sortable column?

          No.

          • 2. Re: How to have sortable column?
            ilya_shaikovsky

            You may use a4j actuion components placed in the headers.

            • 3. Re: How to have sortable column?
              stuartm1971

               

              "ilya_shaikovsky" wrote:
              You may use a4j actuion components placed in the headers.


              I cannot get either a4j:commandLink or a4j:htmlCommandLink to invoke the action methods when they are placed inside header facets of a rich:dataTable. This is required for column sorting.

              Any advice would be appreciated.

              • 4. Re: How to have sortable column?
                ilya_shaikovsky

                post your code here.

                do you have form around your table?

                • 5. Re: How to have sortable column?
                  stuartm1971

                   

                  "ilya_shaikovsky" wrote:
                  post your code here.

                  do you have form around your table?

                  This is my jsp

                  <f:view>





                  <h:form>
                  <rich:dataTable value="#{resultsData.rsResDTO}" var="resdata" binding="#{resultsData.table}"
                  styleClass="receipts"
                  headerClass="receiptsHeader" rowClasses="evenRow, oddRow"
                  onRowClick="rowclick(this, this.rowIndex);">
                  <h:column>
                  <f:facet name="header">
                  <h:commandButton value="GRNO" action="#{resultsData.sortFilterModel.sortByGRNO}" />
                  </f:facet>
                  <h:outputText value="#{resdata.grno}" />
                  </h:column>

                  <h:column>
                  <f:facet name="header">
                  <a4j:htmlCommandLink actionListener="#{resultsData.actioncall}">
                  <h:outputText value="Store" />
                  </a4j:htmlCommandLink>
                  </f:facet>
                  <h:outputText value="#{resdata.storeDesc}" />
                  <h:commandLink action="#{resultsData.sortFilterModel.sortByGRNO}" value="link"/>
                  </h:column>

                  <h:column>
                  ...
                  </h:column>



                  <h:column>
                  <f:facet name="header">
                  <h:outputText value="SKU val" />
                  </f:facet>

                  <h:outputText value="SKU val" />
                  <h:inputText size="1" id="dummyInput" value="dummyVal" style="visibility:hidden">
                  <a4j:support event="onblur" actionListener="#{resultsData.validate}">
                  </a4j:support>
                  </h:inputText>

                  </h:column>

                  </rich:dataTable>

                  <h:commandLink action="#{resultsData.sortFilterModel.sortByGRNO}" value="TEST" />
                  <h:commandButton value="Select receipt..." action="#{resultsData.validate}" style="text-align:center" />

                  <a4j:outputPanel ajaxRendered="true">
                  <h:messages />
                  </a4j:outputPanel>
                  </h:form>
                  </f:view>


                  I'm using rich faces 3.0.0 and ajax4jsf 1.1.0.
                  In a nutshell, sortable links work from within f:facet tags if using h:dataTable. If however I change to rich:dataTable in order to use its increased functionality, the enclosed f:facet links no longer work whether they are a4j:commandLinks, a4j:commandButtons or h:commandLinks.

                  Again, any help would be appreciated.

                  • 6. Re: How to have sortable column?
                    ilya_shaikovsky

                    For me works fine. I advise you to use latest snapshots where numerous fixes was done.

                    • 7. Re: How to have sortable column?
                      stuartm1971

                       

                      "ilya_shaikovsky" wrote:
                      For me works fine. I advise you to use latest snapshots where numerous fixes was done.


                      OK, thanks.

                      We're a little uneasy about using snapshot versions and would like to wait for a stable release, which is why we use 3.0.0. However we have encountered numerous problems and will probably upgrade. Can you suggest which versions of Rich Faces and Ajax4JSF to use(and where they are downloadable from). I'm using JBoss4.0.5 and JSF 1.1_02-b08.

                      Thanks

                      • 8. Re: How to have sortable column?
                        ilya_shaikovsky

                        I want to remind you that now we've released 3 release candidates. And in general only bug fixes work performs now.

                        So any unstability in fromzen 3.0.1 branch musn't be present.

                        So, I advice you lates builds. All the links placed in wiki. I use the latest jar for now without any problems.