4 Replies Latest reply on Jun 27, 2009 6:25 PM by cpopetz

    Wicket AjaxButton

    cruzfernandez

      I am having trouble with AjaxButton in 2.2.1.GA seam-wicket.


      The problem is that it is not propagating the conversationId when submitting the form. If I replace the AjaxLink it propagates the session, but it doesn't submit the form.


      I have recompiled the SeamWebApplication adding a new Listener of type  IActivePageBehaviorListener and it looks like it was fixed:


      Index: src/wicket/org/jboss/seam/wicket/SeamWebApplication.java
      ===================================================================
      --- src/wicket/org/jboss/seam/wicket/SeamWebApplication.java     (revisión: 10342)
      +++ src/wicket/org/jboss/seam/wicket/SeamWebApplication.java     (copia de trabajo)
      @@ -6,6 +6,7 @@
       import org.apache.wicket.Response;
       import org.apache.wicket.Session;
       import org.apache.wicket.behavior.IBehaviorListener;
      +import org.apache.wicket.behavior.IActivePageBehaviorListener;
       import org.apache.wicket.markup.html.form.IFormSubmitListener;
       import org.apache.wicket.markup.html.form.IOnChangeListener;
       import org.apache.wicket.markup.html.link.ILinkListener;
      @@ -77,6 +78,7 @@
                              IFormSubmitListener.INTERFACE.getName().equals(name) || 
                              ILinkListener.INTERFACE.getName().equals(name) ||
                              IBehaviorListener.INTERFACE.getName().equals(name) || 
      +                       IActivePageBehaviorListener.INTERFACE.getName().equals(name) || 
                              IOnChangeListener.INTERFACE.getName().equals(name) ||
                              IRedirectListener.INTERFACE.getName().equals(name) ))
                         {
      
      



      Is this a real fix?

        • 1. Re: Wicket AjaxButton
          cpopetz

          It conceivably is, but all of that code is now gone, because there is a different mechanism in the trunk for handling conversation propagation.  Instead of propagating via url rewriting, we propagate by storing the conversation id in the wicket page metadata.


          This will be part of the upcoming 2.1.2.GA release.

          • 2. Re: Wicket AjaxButton
            cruzfernandez

            I have downloaded the new version 2.1.2.GA and I still have some problems in the event onClick of the Wicket AjaxButton.


            The conversation is propagated correctly but a List of Entites is not activated (I see it with NULL elements). I have debugged more and realized that the EntityBeanList is in passivated state when the onClick handler code accessed the list.


            I have debugged the LifeCycle and I realized the PREPARE_REQUEST step is calling the global UNFLUSH in a temporary conversation context. Afterwards in step RESOLVE_TARGET the conversation is restored to the long-running but the UNFLUSH is never called.


            I have solved for my onClick event adding this ugly code of SEAM:


            @Override
            public void onClick(AjaxRequestTarget target{ 
               ServerConversationContext context = (ServerConversationContext) Contexts.getConversationContext();
               context.unflush();
            }
            



            Is this a problem of Wicket-Seam integration for AjaxButton?

            • 3. Re: Wicket AjaxButton
              mcarrizo

              I have the same problem.... is there a possibility to fix it ? Thank you very much !!


                    Best regards.

              • 4. Re: Wicket AjaxButton
                cpopetz

                It's actually a problem in conversation propagation for seam-wicket.  Please file a jira issue, and I'll fix it.