7 Replies Latest reply on May 24, 2012 10:17 PM by yyq2009

    Problem with: a4j:commandLink with both onclick and actionListener

    jbize

      I am using Richfaces 4.1.0.Final.

       

      I have a problem similar to this: http://stackoverflow.com/questions/10106223/jsf-using-onclick-actionlistener-together, however the suggested remedy (return true;) does not work for me.

      It may be the version of Richfaces I'm using, but upgrading is very difficult for me and I'd like to verify that's the problem first or preferably find a workaround.

       

      I have an a4j:commandLink link in a rich:column in a rich:dataTable in a rich:tab within a rich:tabPanel.  I'd like to click the link, have the column data saved to the backing bean (e.g. via f:setPropertyActionListener) and then have the user switched to another tab for editing (using: #{rich:component('TabPanel')}.switchToItem('EditTab');)

       

      If I use oncomplete for the javascript piece, the handler fires, but the switchToItem piece doesn't work.  If I instead use onclick for the javascript piece, the handler doesn't fire, but the switchToItem piece does work.  I need both.

       

      Does anyone know of a solution?  Is this a known problem in this version of Richfaces?  Does anyone know how I can work around this problem using other components?

       

      I apologize in advance, but I cannot post my code. (I also posted this on stackOverflow hoping to get additional help.)

       

      Thanks,

      John