1 2 Previous Next 18 Replies Latest reply on May 22, 2009 9:23 AM by kusakd Go to original post
      • 15. Re: commandLink / actionparam problem in 3.3.0
        darkmarine

        Yes i tried your solution, but the actionListener is not called. So it seems that the nested actionparam is ignored in this case.

        • 16. Re: commandLink / actionparam problem in 3.3.0
          ilya_shaikovsky

          try to use f:actionListener child tag instead of component attribute. Also listener defined at actionparam should be called.

          • 17. Re: commandLink / actionparam problem in 3.3.0
            darkmarine

            Using the f:actionListener has the drawback that now every bean must implement the ActionListener interface. But the solution works. Thanks.

            • 18. Re: commandLink / actionparam problem in 3.3.0
              kusakd

              Hello guys, this work-around doesn't work with 3.3.1GA. I use a4j:commandLink with some f:setPropertyActionListener and with one f:actionListener.

              <a4j:commandLink
              reRender="FormModalContent"
              oncomplete="Richfaces.showModalPanel('FormModal',{width:450, top:200})"
              rendered="#{rect.type != null}">
               <h:panelGroup id="DocumentRectangle" styleClass="rectangle blue"
               style="width: #{rect.width}px;">
               <h:outputText value=""/>
               </h:panelGroup>
               <f:setPropertyActionListener value="#{rect}" target="#{timelineBean.rect}" />
               <f:setPropertyActionListener value="#{true}" target="#{timelineBean.modifying}" />
               <f:setPropertyActionListener value="#{rectangles.permittedTypes}" target="#{timelineBean.permittedTypes}" />
               <f:actionListener binding="#{timelineBean}" />
              </a4j:commandLink>
              


              public class TimelineBean implements Serializable , ActionListener{
               public void processAction(ActionEvent arg0) throws AbortProcessingException {
               // because of bug - current method isn't called on registered bean!
               try {
               System.out.println("calling processAction()");
               System.out.println(this.toString());
               BeanManager.getTimelineBean().prepareSchedulingForm(null);
               } catch (Exception e) {
               throw new AbortProcessingException(e);
               }
               }
              
              }
              



              1) timelineBean is created, f:setPropertyActionListeners sets data, ok.

              2) then f:actionListener is called. The problem is that processAction() method is not called on bean instance, but on another instance of TimelineBean class, so my application logic don't see parameters which had been set by f:setPropertyActionListeners..

              Am I doing something wrong?

              I found workaround which is weird - in processAction() I get timelineBean instance from FacesContext and call my application logic on that instance..

              Thanks in advance, David


              1 2 Previous Next