1 Reply Latest reply on Jun 7, 2012 11:16 PM by Daniel Yang

    h:commandLink / h:commandButton with rich:componentControl not calling f:setPropertyActionListener

    Karsten Wutzke Expert

      Hello,

       

      does anybody know why the combination of <rich:componentControl> and <f:setPropertyActionListener> isn't working (action not called) in the context of <h:commandLink>/<h:commandButton>?

       

      Here are others who have had the same issue:

       

      http://stackoverflow.com/questions/7214384/richcomponentcontrol-and-setpropertyactionlistener-wont-work-together

      https://community.jboss.org/message/647316

       

      What's the point here?

       

      Karsten

        • 1. Re: h:commandLink / h:commandButton with rich:componentControl not calling f:setPropertyActionListener
          Daniel Yang Novice

          The point here is that your button request is not ajax, and componentControl is just client side control, not server side, from your description you have data to set/update before(right here? or at the same time?) popup, so you'd better use a4j:commandbutton instead of h:commandbutton.

           

          <a4j:commandButton action="#{bean.doAction}"  ...  reRender="popupArea" oncomplete="#{rich:component('popupPanelId')}.show();">

            <f:setPropertyActionListener  .../>

          </a4j:commandButton>

           

          Do not use rich:componentControl, becuase your control is not just client side.

           

          If you don't want to use ajax component, setting show attribute of rich:popupPanel EL expression value, you can control it in your bean action.

           

          <rich:popupPanel show=#{bean.popupVisible}/>

           

          Set default value false, and true when want it popups, and close action you should set popupVisible to false again.