1 Reply Latest reply on Jul 8, 2009 1:00 PM by bossy

    Call an action from an event

    bossy

      Hello,


      I have a case when upon clicking a button I execute an action and depending on the result of that action to either execute an additional action or finish.


      The approach I took is to have something like this:




      <a:commandButton  value="Save" 
          action="#{actBean.doSomething}"
          oncomplete="if(#{list.size>0})
                      {
                       //do something
                      }
                      else
                      {
                        // need to call something else
                        // such as #{anotherActBean.doSomethingElse}                
                      }
                      " />




      My problem is with the else part. How do I call an action from this javascript? The #{anotherActBean.doSomethingElse}  syntax does not seem to be working here.


      Thanks.