9 Replies Latest reply on Jun 12, 2009 6:25 AM by gonorrhea

    DataModelSelection and sortBy Not Functional

    juneau001

      I have an application which works well using the rich:dataTable and using a commandLink for viewing each record via DataModelSelection.  However, I have recently added the sortBy attribute to each of the table columns and this causes big issues.  I have found that once the table is sorted, the DataModelSelection always returns the first row.


      I am using Seam 2.0.0 with RichFaces 3.2.0 SR1.  Has anyone else seen this issue?  If so, is it being addressed?


      Thanks for any assistance.

        • 1. Re: DataModelSelection and sortBy Not Functional
          newion

          Is it a bug in Seam or Richfaces, or maybe it's not a bug but a missing feature?


          Thanks for any explanation.

          • 2. Re: DataModelSelection and sortBy Not Functional
            toby.tobias.hill.gmail.com

            Yes, I ran into this bug too. Same problem with filterBy on rich:dataTable btw.


            Easiest workaround (I haven't found anything easier at least) is to change from:


            <s:link ... action="#{fooBean.editUser(user)}"/>



            to:


            <s:link ... action="#{fooBean.editUser()}">
                 <f:param name="userId" value="#{user.id}"/> 
             </s:link>
            



            ... and catch userId as a @RequestParamater in fooBean. Method editUser() will then have to fetch the user to act upon by finding the matching User in the the datamodel (i.e. you won't have to hit the database ... provided that you have a sufficient scope).

            • 3. Re: DataModelSelection and sortBy Not Functional
              okami

              I have an issue concerning an updated DataModel table as well. I want allow to do a search over the table, but when it's re-rendered, the links are broken somehow, i.e. the method is not even called on the bean.


              <s:link ... action="#{fooBean.editUser(user)}"/>



              Only appears after first update of search string (done like in booking example). After the first page refresh the links are ok.

              • 4. Re: DataModelSelection and sortBy Not Functional
                dan.j.allen

                First things first. Is the DataModel stored in the PAGE scope, CONVERSATION scope + long-running conversation, or SESSION? If not, DataModelSelection will be off.

                • 5. Re: DataModelSelection and sortBy Not Functional
                  juneau001

                  Yes, I am definitely using SESSION scope for the datamodel.  Moreover, the datamodel was working fine until I added the sort option on my table.  The selection works out great until the table is sorted, then it fails and always returns the first row in the model.


                  Thanks to Tobias' response above, I have corrected the selection issue.  His example above is the workaround solution for this bug. 

                  • 6. Re: DataModelSelection and sortBy Not Functional
                    toppac.toppac.gmail.com

                    Since these forums tend to be worthless (i.e. unhelpful and rude developers) I will try to help. We had a similar problem recently, except our dataModel indexes were out of whack when we did the sort. Updating to RichFaces 3.2.2 SR1 fixed the problem. I know they had a few JIRAs in that release that dealt with dataTables and sorting so it may have fixed your problem as well. Give it a try.

                    • 7. Re: DataModelSelection and sortBy Not Functional
                      gonorrhea

                      Allan Topp wrote on Feb 26, 2009 05:00:


                      Since these forums tend to be worthless (i.e. unhelpful and rude developers) I will try to help.


                      I don't necessarily agree with that statement.  If you consider the huge and helpful amount of data/tips in JPA with Hibernate and SiA, for example, those are fantastic books and a great start.  A lot of the basic questions in this forum can be answered in this books.


                      It seems to me that the Seam core devs are not participating as much as they used to (say 1-2 yrs ago) in this forum and the older Seam forum.  But Max Andersen is very helpful (JBoss Tools project lead) and follows up with the resolution of forum cases pretty well.  The Richfaces core devs respond regularly as well.


                      • 8. Re: DataModelSelection and sortBy Not Functional
                        dan.j.allen
                        It seems to me that the Seam core devs are not participating as much as they used to (say 1-2 yrs ago) in this forum and the older Seam forum.


                        Regrettably, we've just been extremely tied up lately. As the JSR-299 spec wraps up near the end of the summer, you'll very likely see a return of more regular participation from us (in one form or another).


                        With that said, the number of blog entries posted on in.relation.to has been more regular than ever before. So it's not like we vanished ;)

                        • 9. Re: DataModelSelection and sortBy Not Functional
                          gonorrhea

                          GKing has been very active in the Web Beans forum (and he's not shy about making myself and others look like idiots but that's fine, that's what happens when you don't read the entire 299 spec and start asking weirdo questions!)