SPRING 3.0.5 - WEBFLOW 2.3.0 - PRIMEFACES 2.2.1 - (Running on GAE 1.4.2)
Hi,
I am pretty new to both Spring & Primefaces, and at the moment, can't work out where the issue I'm having lies - so apologies in advance if this is a PF issue!
The scenario, a basic example to illustrate the issue, is that I have a form, where I have a button to trigger a transition, and then lazy load another button, to trigger another transition:
Code:<ui:define name="content"> <h:form> <p:outputPanel id="panel"> <p:commandButton value="Standard" action="testnormal" /> <p:commandButton value="LazyLoaded" action="testlazyload" rendered="#{requestScope.renderLazy}" /> <p:commandButton value="LazyLoad" update="panel"> <f:setPropertyActionListener target="#{requestScope.renderLazy}" value="#{true}" /> </p:commandButton> </p:outputPanel> </h:form> </ui:define>
The 'Standard' button triggers the transition as expected, the 'LazyLoad' button, does the lazy load, but the lazy loaded 'LazyLoaded' button does not trigger the transition?
The flow is:
When the 'Standard' button is pressed, the (important part of the) log shows:Code:<view-state id="start"> <transition on="testnormal" to="continue" /> <transition on="testlazyload" to="continue" /> </view-state> <view-state id="continue"> <transition on="done" to="finish" /> </view-state> <end-state id="finish" view="externalRedirect:contextRelative:/a/process/test"/>
But when the 'LazyLoaded' button is pressed, it shows:Code:12:08:42,723 DEBUG - Entering JSF Phase: INVOKE_APPLICATION 5 12:08:42,723 DEBUG - Processing application 12:08:42,725 DEBUG - Invoking action javax.faces.component.MethodBindingMethodExpressionAdapter@94c7cbf9 12:08:42,725 DEBUG - Event 'testnormal' detected 12:08:42,725 DEBUG - Event 'testnormal' returned from view [JSFView = '/WEB-INF/classes/web/process/test/start.xhtml'] 12:08:42,725 DEBUG - Executing [Transition@1a6e654 on = testnormal, to = continue] 12:08:42,725 DEBUG - Exiting state 'start' 12:08:42,725 DEBUG - Saving view root '/WEB-INF/classes/web/process/test/start.xhtml' in view scope 12:08:42,726 DEBUG - Entering state 'continue' of flow 'process/test' 12:08:42,726 DEBUG - Assigned key e1s2 12:08:42,726 DEBUG - Completed transition execution. As a result, the new state is 'continue' in flow 'process/test' 12:08:42,726 DEBUG - Putting flow execution '[FlowExecutionImpl@1f08e8b flow = 'process/test', flowSessions = list[[FlowSessionImpl@7858ab flow = 'process/test', state = 'continue', scope = map['viewScope' -> map[[empty]]]]]]' into repository 12:08:42,726 DEBUG - Adding snapshot to group with id 2 12:08:42,726 DEBUG - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[null] -> list[[empty]]], 'flowRenderResponse' -> true]] 12:08:42,727 DEBUG - Unlocking conversation 1 12:08:42,727 DEBUG - Sending flow execution redirect to '/a/process/test?execution=e1s2' 12:08:42,728 DEBUG - Null ModelAndView returned to DispatcherServlet with name 'MVC_Dispatcher': assuming HandlerAdapter completed request handling 12:08:42,728 DEBUG - Successfully completed request 12:08:42,728 DEBUG - Chain processed normally
Apparently NOT detecting the EVENT ?????Code:12:12:19,626 DEBUG - Entering JSF Phase: INVOKE_APPLICATION 5 12:12:19,626 DEBUG - Processing application 12:12:19,626 DEBUG - Rendering + [JSFView = '/WEB-INF/classes/web/process/test/start.xhtml'] 12:12:19,626 DEBUG - Flash scope = map[[empty]] 12:12:19,626 DEBUG - Messages = [DefaultMessageContext@1f62688 sourceMessages = map[[null] -> list[[empty]]]] 12:12:19,626 DEBUG - Asking faces lifecycle to render 12:12:19,627 DEBUG - Entering JSF Phase: RENDER_RESPONSE 6 12:12:19,627 DEBUG - Saving view root '/WEB-INF/classes/web/process/test/start.xhtml' in view scope 12:12:19,627 DEBUG - Saving view root '/WEB-INF/classes/web/process/test/start.xhtml' in view scope 12:12:19,627 DEBUG - View rendering complete 12:12:19,628 DEBUG - Putting flow execution '[FlowExecutionImpl@15bc55e flow = 'process/test', flowSessions = list[[FlowSessionImpl@1fad24e flow = 'process/test', state = 'start', scope = map['viewScope' -> map['flowSerializedViewState' -> [FlowSerializedView@53644 viewId = '/WEB-INF/classes/web/process/test/start.xhtml']]]]]]' into repository 12:12:19,628 DEBUG - Adding snapshot to group with id 1 12:12:19,628 DEBUG - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[empty]]]] 12:12:19,628 DEBUG - Unlocking conversation 2 12:12:19,628 DEBUG - Null ModelAndView returned to DispatcherServlet with name 'MVC_Dispatcher': assuming HandlerAdapter completed request handling 12:12:19,628 DEBUG - Successfully completed request 12:12:19,628 DEBUG - Chain processed normally
Looking at the produced HTML, there appears to be NO difference between the code generated for each button:
As you can see from the "id's" above, this isn't a nested form issue!Code:<span id="j_idt11:panel"> <button id="j_idt11:j_idt12" name="j_idt11:j_idt12" onclick="PrimeFaces.ajax.AjaxRequest('/a/process/test?execution=e2s1', {formId:'j_idt11',async:false,global:true,source:'j_idt11:j_idt12',process:'@all'});return false;" type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Standard</span></button> <button id="j_idt11:j_idt13" name="j_idt11:j_idt13" onclick="PrimeFaces.ajax.AjaxRequest('/a/process/test?execution=e2s1', {formId:'j_idt11',async:false,global:true,source:'j_idt11:j_idt13',process:'@all'});return false;" type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">LazyLoaded</span></button> <button id="j_idt11:j_idt14" name="j_idt11:j_idt14" onclick="PrimeFaces.ajax.AjaxRequest('/a/process/test?execution=e2s1', {formId:'j_idt11',async:false,global:true,source:'j_idt11:j_idt14',process:'@all',update:'j_idt11:panel'});return false;" type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">LazyLoad</span></button> </span>
Checking the browser side network traffic, the 'Lazy Loaded' button produces the following:
Code:POST HEADER Request URL:http://127.0.0.1:8888/a/process/test?execution=e3s1 Request Method:POST Status Code:200 OK Request Headers Accept:application/xml, text/xml, */*; q=0.01 Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-GB,en-US;q=0.8,en;q=0.6 Connection:keep-alive Content-Length:213 Content-Type:application/x-www-form-urlencoded Cookie:JSESSIONID=kf4u18ge29aj Faces-Request:partial/ajax Host:127.0.0.1:8888 Origin:http://127.0.0.1:8888 Referer:http://127.0.0.1:8888/a/process/test?execution=e3s1 User-Agent:Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.14 Safari/534.24 X-Requested-With:XMLHttpRequest Query String Parameters execution:e3s1 Form Data j_idt11:j_idt11 javax.faces.ViewState:e3s1 javax.faces.partial.ajax:true javax.faces.source:j_idt11:j_idt14 javax.faces.partial.execute:@all javax.faces.partial.render:j_idt11:panel j_idt11:j_idt14:j_idt11:j_idt14 Response Headers Cache-Control:no-cache no-store no-cache Content-Length:1388 Content-Type:text/xml; charset=utf-8 Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(6.1.x) X-Powered-By:JSF/2.0 RETURNED CONTENT <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="j_idt11:panel"><![CDATA[<span id="j_idt11:panel"><button id="j_idt11:j_idt12" name="j_idt11:j_idt12" onclick="PrimeFaces.ajax.AjaxRequest('/a/process/test?execution=e3s1',{formId:'j_idt11',async:false,global:true,source:'j_idt11:j_idt12',process:'@all'});return false;" type="submit">Standard</button><script type="text/javascript">widget_j_idt11_j_idt12 = new PrimeFaces.widget.CommandButton('j_idt11:j_idt12', {});</script><button id="j_idt11:j_idt13" name="j_idt11:j_idt13" onclick="PrimeFaces.ajax.AjaxRequest('/a/process/test?execution=e3s1',{formId:'j_idt11',async:false,global:true,source:'j_idt11:j_idt13',process:'@all'});return false;" type="submit">LazyLoaded</button><script type="text/javascript">widget_j_idt11_j_idt13 = new PrimeFaces.widget.CommandButton('j_idt11:j_idt13', {});</script><button id="j_idt11:j_idt14" name="j_idt11:j_idt14" onclick="PrimeFaces.ajax.AjaxRequest('/a/process/test?execution=e3s1',{formId:'j_idt11',async:false,global:true,source:'j_idt11:j_idt14',process:'@all',update:'j_idt11:panel'});return false;" type="submit">LazyLoad</button><script type="text/javascript">widget_j_idt11_j_idt14 = new PrimeFaces.widget.CommandButton('j_idt11:j_idt14', {});</script></span>]]></update><update id="javax.faces.ViewState"><![CDATA[e3s1]]></update></changes></partial-response>
I really now pulling my hair out with this, (I didn't have much to start with) - Can anybody see what's wrong???
I am assuming this should work?!?
If there is any other part of the config wanted, please let me know.
Thanks in advance
Dave


Reply With Quote
