5 Replies Latest reply on Aug 11, 2010 8:00 AM by ilya_shaikovsky

    Problem with List-Shuttle

    deepusrp

      Hello All,

       

      I'm using list shuttle and i'm facing some problem using it...

       

      Let me tell you how i'm using it...:

       

      XHTML page:

       

                <rich:listShuttle id="bulkUpdate" sourceValue="#{nnPageForm.sourcennList}" targetValue="#{nnPageForm.targetnnList}" 
                                    var="items" sourceCaptionLabel="Source List"

                                    targetCaptionLabel="Target List" orderControlsVisible="false" fastOrderControlsVisible="false" >
                      <rich:column>


                           <f:facet name="header">
                              <h:outputText value="NPA" />
                           </f:facet>
                          <h:outputText value="#{items.npa}" />
                      </rich:column>
                      <rich:column>
                          <f:facet name="header">
                              <h:outputText value="NXX" />
                           </f:facet>
                          <h:outputText value="#{items.nxx}" />
                      </rich:column>
                  </rich:listShuttle>

       

      During the initialization of the page form, i'm populating the lists with respective value:

       

      setSourcennList(getNnDbManager().findAll());  // this will fetch the list from DB

      setTargetnnList(new ArrayList<NpaNxx>());     // instantiating the list

       

      Now the problems:

       

      1.  Its giving one exception during runtime and surprisingly no error on the console:  Please let me know why this is happening

       

           "Component  j_id53:bulkUpdate has invalid value expression  xxx.xxxx.xxxx.xxx.impl.NpaNxx@4cae7a"

       

      2.  This is related to CSS:

           in my page, it doesnt look good... it comes with somany extra spaces(Marked in Red box) .  How to fix this

       

      problem.JPG

        • 1. Re: Problem with List-Shuttle
          boy18nj

          Regarding your first error, you need to use Converter. You can either refer converter in your page.xml or xhtml itself.

           

          Second error, unless you are using your own css style, by default you won't see this space.

          1 of 1 people found this helpful
          • 2. Re: Problem with List-Shuttle
            ilya_shaikovsky

            Thanks Aman S! I will just add some details to your answer.

            Regarding your first error, you need to use Converter. You can either refer converter in your page.xml or xhtml itself.

             

            The component requires converter and implementation of equals and hashCode for object as it doesn't works with just SelectItems as normal select does but with any object which it should know how to compare and add to the model. You could check the working same there http://livedemo.exadel.com/richfaces-demo/richfaces/listShuttle.jsf and checkout full sources from svn (info there - http://jboss.org/richfaces/demos)

             

            Second error, unless you are using your own css style, by default you won't see this space.

            Thats also looks like the reason of such visula glitches. and in order to check which styles causes that - use FireBug for FireFox.

            1 of 1 people found this helpful
            • 3. Re: Problem with List-Shuttle
              deepusrp

              Hello All,

               

              First of all, thanks Aman and Ilya...

               

              Actually i figured out the soulution for my first problem...  Some where in the forum it is clearly mentioned that, for a list shuttle, if the list is other than the String list it has to have a custom convertor... So i had implemented that and its working the way i wanted... (But i forgot to update as it was very late yesterday night).

               

              I need one more clarification, i have overridden the 'equals' method but have not done the 'hashcode'.... is it mandatory to have hashcode also overridden?

               

              And regarding that CSS, i need to check it out...

               

              Thanks a lot for ur reply...

               

              Thanks

              Deepak

              • 4. Re: Problem with List-Shuttle
                deepusrp

                Hello All,

                 

                The problem related to the error of listShuttle got solved.

                 

                Now i'm concentrating on the UI...  I tried to alter the CSS for the list-Shuttle component but could not figure out which one is acting...

                 

                Please find the attachment of the snapshot taken from Firebug...  The one marked in red box relates to the 'Copy All' Button.  Please let me know why i'm getting that extra space that i had marked in my first post for the 'Copy All' button.

                 

                 

                Thanks in Advance...

                 

                Deepak

                • 5. Re: Problem with List-Shuttle
                  ilya_shaikovsky

                  that not helps as need to check different ell ements in order to see which styles causes that. probably element which defines border has some unnesessary paddings applied or inner ones has margins. from the begining take your own css declarations off and check that things are fine. then review which of the classes could cause that.