2 Replies Latest reply on Sep 26, 2012 5:10 AM by Thomas Buckley

    Change display order of rich:picklist buttons

    Thomas Buckley Newbie

      I'm using Richfaces 4.2 and JSF2.

      I have the following:

      <rich:pickList id="internationalTransactionCountriesPicklist"

                    value="#{rule.ruleControls.GeographicControl.selectedValues}"

                    sourceCaption="#{msg.AvailableCountries}"

                    targetCaption="#{msg.SelectedCountries}"

                    addText="#{msg.picklistSelectItemButtonLabel}"

                    addAllText="#{msg.picklistSelectAllItemButtonLabel}"

                    removeText="#{msg.picklistDeselectItemButtonLabel}"

                    removeAllText="#{msg.picklistDeselectAllItemButtonLabel}"

                    listHeight="150px"

                    disabled="#{myBean.userIsReadOnly rule.ruleParams.Action.propertySelected == 'false'}"

                    readonly="#{myBean.userIsReadOnly}">

                    <f:selectItems value="#{myBean.fullCountryList}"

                              var="country" itemValue="#{country.countryCode}"

                              itemLabel="#{country.displayName}" itemLabelEscaped="true" />

          </rich:pickList>

       

       

      The buttons are displayed "Add All", "Add", "Remove", "Remove All" from top to bottom in that order (Between the two lists obviously).

      There is no attributes on the component to adjust their positioning.

      Is there some way to do it in xhtml?
      i.e. Display them as "Add", "Add All", "Remove", Remove All".

      Thanks

        • 1. Re: Change display order of rich:picklist buttons
          Brendan Healey Master

          What's your jquery like? The controls have class names .rf-pick-add-all .rf-pick-add .rf-pick-rem .rf-pick-rem-all,

          I can't remember any more detail but I use these class names to set the 'title' attribute in a jquery ready handler.

           

          If you have something like this:

           

          <h:outputText id="my1" value="my1"/>

          <h:outputText id="my2" value="my2"/>

           

          Then you could swap the elements in the dom with this:

           

          jQuery(function($) {

            $("#my2").insertBefore("#my1");

          });

           

          The ready handler should ideally be in the head. I don't know if it'll work, my picklist code is out of action at

          present as I'm doing some work on it but perhaps you could give this a try, just use jQuery(".rf-pick-add")

          instead of "#my1", and move them about until they're in the right order.

           

          Regards,

          Brendan.

          1 of 1 people found this helpful
          • 2. Re: Change display order of rich:picklist buttons
            Thomas Buckley Newbie

            Sorry for the late reply Brendan.

             

            My jQuery is quite good.

             

            For the moment this requirement has dropped well down my list of things to do!

             

            In theory this seems like a good idea.

            I'll let you know if I get around to trying this out though.

             

            Thomas