8 Replies Latest reply on Jul 27, 2012 8:10 PM by sivaji.balla

    how to fire the event action on rich:picklist

    sivaji.balla

      Hi to all,

      I am useing the rich:picklist.

      how to fire the event action firing on rich:picklist.

      could  please any one help me.

      Here is my code

       

       

                                  <rich:pickList value="#{pagesAc.bigdeclist}">

                                  

                                      <s:selectItems var="enab" value="#{pagesAc.enabledList}" label="#{enab.description}" itemValue="#{enab.lookupCodeId}"/>

                                                                                  

                                  </rich:pickList>

        • 1. Re: how to fire the event action on rich:picklist
          healeyb

          Take a look at this and see it is of any help https://community.jboss.org/message/729682#729682

           

          Regards,

          Brendan.

          • 2. Re: how to fire the event action on rich:picklist
            sivaji.balla

            hi Bredan Healey,

            thanks for quick reply.

            I read the above link.

            But i want firing event action (to call the method in bean class) on the assigned values.

            That is if i cllcking(onclick event) the assigned value,then  i want to firing the action.

            please help me.

            thanks in advanced.

            • 3. Re: how to fire the event action on rich:picklist
              iabughosh

              Hello sivaji,

              try using a4j:jsFunction :

               

              <rich:pickList id="pickList"

                                   value="#{yourBean.value}">

                   <f:selectItems value="#{yourBean.items}"/>

                                            <a4j:ajax event="additems" execute="@this" render="@none" oncomplete="executeAction()"/>

                                            <a4j:ajax event="removeitems" execute="@this" render="@none" oncomplete="executeAction()"/>

                                  </rich:pickList>

                                  <a4j:jsFunction name="executeAction"

                                                          action="#{yourBean.yourAction}">

                                  </a4j:jsFunction>

               

              regards.

              • 4. Re: how to fire the event action on rich:picklist
                sivaji.balla

                hi Ibrahlm,

                thanks for quick reply.

                i tried with above said solution.But i am not getting the tag called <a4j:ajax> in <rich:pickList>.

                How to getting that <a4j:ajax>.

                and here <a4j:jsFunction>'s action is not fired.

                could please help me

                • 5. Re: how to fire the event action on rich:picklist
                  healeyb

                  What's happening when you try Ibrahim's code? the a4j:ajax tag is nested within the rich:pickList, just like the f:selectItems.

                  As long as you have xmlns:a4j="http://richfaces.org/a4j" in the taglibs it's hard to see what could not be working. Is the code

                  in a h:form?

                   

                  Regards,

                  Brendan.

                  • 6. Re: how to fire the event action on rich:picklist
                    sivaji.balla

                    hi Brendan Healey,

                    thanks for your reply.

                    I tried a4j:ajax.But that tag is not fired action in action class. Here i nested a4j:ajax in rich:pickList.

                    And the code is in h:form.

                    any solution please.

                    • 7. Re: how to fire the event action on rich:picklist
                      healeyb

                      Firstly, I think it would be helpful to describe exactly what it is you're trying to do, it's not entirely clear. Next, I don't

                      fully understand what you mean by tried a4j:ajax.But that tag is not fired action in action class what does this mean?

                       

                      If you go back to the link I included in the 1st reply to this topic I describe a technique where the additems & removeitems

                      client side events call an a4j:jsFunction. Now this works, I use it all the time and other people have indicated that it also

                      works for them, so if it doesn't work for you you must be doing something wrong.

                       

                      What you can do is try something like this:

                       

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

                        <a4j:ajax event="additems" oncomplete="alert('add')"/>

                        <a4j:ajax event="removeitems" oncomplete="alert('remove')"/>

                      </rich:pickList>

                       

                      If you see the javascript popup then the client side events are firing, then you just need to replace alert with an

                      a4j:jsFunction. This is assuming that adding/removing items from the right hand side of the pickList is what you're

                      trying to achieve.

                       

                      Regards,

                      Brendan.

                      • 8. Re: how to fire the event action on rich:picklist
                        sivaji.balla

                        hi Brendan Healey,

                        I think the problem is with my version.

                        I am using richfaces 2.x.is it problem with 2.x.means is it (<a4j:ajax>) worked in richfacess2.x.

                        could please help me.