9 Replies Latest reply on Jul 21, 2009 4:00 AM by qwertywin

    ScrollabeDataTable selection not working.

    qwertywin

      Ok so this is starting to do my head in,


      I can't get selection's to work, It seams that the form never submits when im doing a selection, so it is never set in my bean, when I do column sorting however, it makes the call and sets the selection to null.



      <a:form >
      <rich:scrollableDataTable id="portalLadderTable"
                                                                                                   rendered="#{portalHome.ladders.size > 0}"
                                                                                                        value="#{portalHome.ladders}"
                                                                                                        var="_ladder"
                                                                                                        width="550px"
                                                                                                        height="160px"
                                                                                                        selection="#{portalAdmin.selection}"
                                                                                                        rowKeyVar="rkv"
                                                                                                        sortMode="single"
                                                                                                        frozenColCount="1"
                                                                                                    >      
                                                                               <rich:column >
                                                                                   <f:facet name="header">Ladder Name</f:facet>
                                                                                  <h:outputText value="#{_ladder.ladderName}"/>
                                                                              </rich:column>                     
                                                                                                                                              </rich:scrollableDataTable>
                                                                          
                                                                                                      </a:form>



      and my bean



      @Name("portalAdmin")
      @Scope( ScopeType.CONVERSATION )
      public class PortalAdmin {
           
           @In PortalHome portalHome;
           
           private Selection selection = new SimpleSelection();
           
           public Selection getSelection(){
                System.out.println("get selection");
                return this.selection;
           }
           
           public void setSelection( Selection selection ){
                System.out.println("set selection");
                this.selection = selection;
           }
      
      }
      



      I have been racking my brain for 3 days over this, still nothing, if anyone can point me in the right direction that'd be great.






        • 1. Re: ScrollabeDataTable selection not working.
          qwertywin

          sorry, properly formatted scrollableDataTable



          <a:form >
               <rich:scrollableDataTable id="portalLadderTable"
                         rendered="#{portalHome.ladders.size > 0}"
                         value="#{portalHome.ladders}"
                         var="_ladder"
                         width="550px"
                         height="160px"
                         selection="#{portalAdmin.selection}"
                         rowKeyVar="rkv"
                         sortMode="single"
                         frozenColCount="1" >      
                    <rich:column >
                         <f:facet name="header">Ladder Name</f:facet>
                         <h:outputText value="#{_ladder.ladderName}"/>
                    </rich:column>                     
               </rich:scrollableDataTable>                                                               
          </a:form>




          • 2. Re: ScrollabeDataTable selection not working.
            qwertywin

            I'll take that as no-one knows

            • 3. Re: ScrollabeDataTable selection not working.
              scatudal

              Are you in a long running conversation?  That's what I would look into first.


              • 4. Re: ScrollabeDataTable selection not working.
                scatudal

                What I just said doesn't make any sense since richfaces can be used without Seam and I was talking about seam conversations.


                I said that because I was trying to break some code so I could help you out. Removing the long running conversation did just that.


                Hope it helps you out...

                • 5. Re: ScrollabeDataTable selection not working.
                  qwertywin

                  So I should be in a long running converstion?


                  I do not believe I am, so ill take a look and try it out tonight.

                  • 6. Re: ScrollabeDataTable selection not working.
                    qwertywin

                    though I still believe this may be more of a richfaces issue, because the selection action is never submitted, during normal selection, only when reloading the page, or changing the sort order.

                    • 7. Re: ScrollabeDataTable selection not working.
                      scatudal

                      What is the action called and how is it called?

                      • 8. Re: ScrollabeDataTable selection not working.
                        qwertywin


                        selection="#{portalAdmin.selection}"



                        calls


                             private Selection selection = new SimpleSelection();
                             
                             public Selection getSelection(){
                                  System.out.println("get selection");
                                  return this.selection;
                             }
                             
                             public void setSelection( Selection selection ){
                                  System.out.println("set selection");
                                  this.selection = selection;
                             }



                        when you make a row selection, but the call never happens...

                        • 9. Re: ScrollabeDataTable selection not working.
                          qwertywin

                          lol ok totally stupid moment here


                          I had assumed that the form was submitted when ever a selection was made - thus being set


                          but I was totally incorrect, it is only when you use a button for instance, that the form is submitted, thus the selection set.


                          sorry for wasting your time.