4 Replies Latest reply on Jun 13, 2012 5:23 PM by Parsi Kumar

    RF 4.2 PickList

    mrenninger Newbie

      Hi, a <a4j:ajax event="change"> won't work inside a <rich:pickList> on Firefox 11 or Chrome (no ajax call is done). With IE9 it works. Is it possible to fix it?

        • 1. Re: RF 4.2 PickList
          Brendan Healey Master

          Hi, interesting that there are browser differences. Are there any js errors showing in the console for firefox/chrome?

          I just took a look at how I'm dealing with this and I use these nested tags inside the picklist:

           

          <rich:pickList id="picklist" ...>

            <a4j:ajax event="additems" oncomplete="jsPicklistChanged()"/>

            <a4j:ajax event="removeitems" oncomplete="jsPicklistChanged()"/>

          </rich:pickList>

           

          <a4j:jsFunction name="jsPicklistChanged" actionListener="#{bean.picklistChanged}" execute="picklist"/>

           

          See also (&vote for):

           

          https://issues.jboss.org/browse/RF-11617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

           

          Regards,

          Brendan.

           

          p.s. Is this the first time in the history of the internet where something works in IE but not in other browsers :-)

          1 of 1 people found this helpful
          • 2. Re: RF 4.2 PickList
            mrenninger Newbie

            Hi Brendan,

            there are no errors displayed in the console of firefox.

             

            I have debuged/tested a lot and i think it is a problem focus/blur-events of the picklist. In example, if i click the add button the blurHandler of the picklist is called but the targetList hasn't at this time the added entry and therefore the change-event won't be fired. A click outside the picklist, that normally should fire the change-event (like other components), also triggers the blurHandler of the picklist, but the focused-flag is already false (the previous call of the blurHandler has it setted) and therefore the blurHandler do nothing.

             

            Thanks for the workaround. It works.

             

            Regards, Michael

            • 3. Re: RF 4.2 PickList
              Brendan Healey Master

              Glad to be of help.

              • 4. Re: RF 4.2 PickList
                Parsi Kumar Newbie

                Replaced 'change' event with 'additems, removeitems, sourceblur, sourcefocus, targetblur and targetfocus' events and it worked for me. There could be some redundant code in this temporary fix but it solved the problem at least. Suggestions are always welcome. Thanks.

                 

                 

                Old ( change event doesn't work):

                <rich:pickList ...>

                <f:ajax event="change" .. />

                 

                <f:selectItems.. />

                <f:converter converterId="someConverter" />

                </rich:pickList>

                 

                New (works):

                <rich:pickList ...>

                <f:ajax event="additems" .. />
                <f:ajax event="removeitems" .. />
                <f:ajax event="sourceblur" .. />
                <f:ajax event="sourcefocus" .. />
                <f:ajax event="targetblur" .. />
                <f:ajax event="targetfocus" .. />

                 

                <f:selectItems.. />

                <f:converter converterId="someConverter" />

                </rich:pickList>

                 

                 

                I hope this helps.

                 

                Versions:

                RichFaces 4.2

                JSF 2.1.7