7 Replies Latest reply on Aug 31, 2007 7:52 AM by Pete Muir

    Seam conflict with a4j:include and a4j:support

    John Gilbert Apprentice

      I have already shared this with the ajax4jsf forum, but they believe this is more of a seam issue.

      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076264#4076264


      I am using a4j:support and onblur to do field validation on an edit screen.

      The edit page works fine standalone.

      When the edit screen is included using a4j:include i get some weird conflicts.

      1 - When no field is selected the Save button works fine.

      2 - When a field is selected and the save button is pressed then 2 requests are fired. One for onblur and one for pressing the button. Sometimes this works fine, but most times a NPE is thrown.

      Is there anyway to ensure these 2 requests don't conflict?



      Caused by: java.lang.NullPointerException
       at org.jboss.seam.core.Manager.isReallyLongRunningConversation(Manager.java:247)
       at org.jboss.seam.core.Conversation.isLongRunning(Conversation.java:312)
       at org.jboss.seam.ui.UIConversationId.getValue(UIConversationId.java:33)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.addChildParametersToHr
      ef(HtmlLinkRendererBase.java:381)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.renderOutputLinkStart(
      HtmlLinkRendererBase.java:399)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.encodeBegin(HtmlLinkRe
      ndererBase.java:101)
       at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:512)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
       at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
       at org.ajax4jsf.portlet.application.PortletViewHandler.renderView(PortletViewHandler.java:42
      )
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at org.ajax4jsf.portlet.AjaxFacesPortlet.render(AjaxFacesPortlet.java:266)
       at org.ajax4jsf.portlet.AjaxFacesPortlet.doView(AjaxFacesPortlet.java:177)
      
      


        • 2. Re: Seam conflict with a4j:include and a4j:support
          Tim Newbie

          Seem to be the problem I got right now. Things seem fine yesterday, now all hell broke lose without a cause. After you jump off the field, everything disappears. So weird.

          • 3. Re: Seam conflict with a4j:include and a4j:support
            demetrio812 Apprentice

            Also another case:

            I putted a selectOneMenu with a:support inside it...

            Then select an element and while support is updating the bean via ajax request (u can see using the a:status component) I select another element.

            When I select the second element the page is reloaded with the message " The conversation ended, timed out or was processing another request"...

            I'm using a modified sea-gen generated app. Maybe it's the same problem...

            Demetrio Filocamo

            • 4. Re: Seam conflict with a4j:include and a4j:support
              Tim Newbie

              Gents,

              I believe it also has something to do with Ajax2j because I find out when I switch over to use <rich:tabPanel> and <rich:tab>, everything is working fine. That's how my pages work before but not after my "simple" change.
              Try it out and let me know. Don't use <rich:panel>

              • 5. Re: Seam conflict with a4j:include and a4j:support
                demetrio812 Apprentice

                Hi,
                no for me it's the same, I putter the <a:form>...</a:form> out of all and it give to me the same error...

                another issue I found: I have <rich:tabPanel switchType="ajax" ...

                If I click 2 or more time to a tab to switch the tab panel it give me the same error...

                So I think that the problem is related to multiple ajax requests...

                Demetrio

                • 6. Re: Seam conflict with a4j:include and a4j:support
                  demetrio812 Apprentice

                  The code that I use to show the problem is that:

                   <a:form ajaxSubmit="true" id="formAC">
                   <h:outputText value="Tipologia: "></h:outputText>
                   <h:selectOneMenu id="tipologiaAC" value="#{articoloHelper.tipologiaArticoloDaCollegare}">
                   <s:selectItems value="#{tipologiaArticoloAll.resultList}" var="tip" label="#{tip.descrizione}" noSelectionLabel="Seleziona la tipologia..."/>
                   <s:convertEntity />
                   <a:support event="onchange" reRender="articoliACop" ajaxSingle="true">
                   </a:support>
                   </h:selectOneMenu>
                   <a:outputPanel id="articoliACop">
                   <h:outputText value="Oggetto da collegare: " rendered="#{articoloHelper.tipologiaArticoloDaCollegare!=null}"></h:outputText>
                   <h:selectOneMenu id="articoliAC" value="#{articoloHelper.articoloDaCollegare}" rendered="#{articoloHelper.tipologiaArticoloDaCollegare!=null}">
                   <s:selectItems value="#{articoloHelper.articoliCollegabili}" var="tip" label="#{tip.titolo}" noSelectionLabel="Seleziona un oggetto..."/>
                   <s:convertEntity />
                   <a:support event="onchange" reRender="btnACop" ajaxSingle="true"></a:support>
                   </h:selectOneMenu>
                   </a:outputPanel>
                   <a:outputPanel id="btnACop">
                   <a:commandButton id="btnAC" value="Collega" action="#{articoloHelper.collegaArticolo(articoloHome.instance)}"
                   rendered="#{articoloHelper.articoloDaCollegare!=null}" reRender="opArticoliCollegati"></a:commandButton>
                   </a:outputPanel>
                   <a:status startText="Aggiornamento dati in corso..."></a:status>
                   </a:form>
                  


                  Demetrio

                  • 7. Re: Seam conflict with a4j:include and a4j:support
                    Pete Muir Master

                    jgilbert: I'm going to need a test case for this. Create a new seam-gen'd app, add enough code to reproduce your problem, remove the lib directory, zip it up, email it to me (or add to a new jira issue) and include reproduction steps.