Hi all, this is my first post.
As I said in the title I've some problems running Ajax with webflow. I've read all documentation:
I've configure all like said documentation:
webmvc-config.xml:
All the configuration are ok and working without ajax. The javascript are imported correctly.Code:<bean id="tilesViewResolver" class="org.springframework.js.ajax.AjaxUrlBasedViewResolver"> <property name="viewClass" value="org.springframework.webflow.mvc.view.FlowAjaxTilesView" /> </bean>
I have 2 viewstate:
Those are the tilesCode:<view-state id="enterFornitoreDetails" view="fornitore.dettaglio" > <on-entry> <evaluate expression="fornitoreService.getDettaglioFull(codiceFornitore, profilo)" result="flowScope.fornitore" /> </on-entry> <on-render> <render fragments="body" /> </on-render> <transition on="modifica" to="enterFornitoreModify" /> <transition on="chiudi" to="endFlow" /> </view-state> <view-state id="enterFornitoreModify" view="fornitore.modifica" > <on-render> <render fragments="body" /> </on-render> <transition on="saveAndClose" to="fornitoreModified"> <evaluate expression="fornitoreService.save(codiceFornitore, profilo)" result="flowScope.fornitore" /> </transition> <transition on="cancelAndClose" to="fornitoreUnmodified" /> </view-state>
andCode:<tiles-definitions> <definition name="layout" template="/WEB-INF/jsp/layout.jsp"> <put-attribute name="menu1lev" value="/WEB-INF/jsp/menu1lev.jsp" /> <put-attribute name="menu2lev" value="/WEB-INF/jsp/menu2lev.jsp" /> <put-attribute name="body" value="/WEB-INF/jsp/indexBody.jsp" /> </definition> </tiles-definitions>
The JSP to start the "modifica" event is this this:Code:<tiles-definitions> <definition name="fornitore.dettaglio" extends="layout"> <put-attribute name="body" value="/WEB-INF/jsp/fornitore/dettaglio.jsp" /> </definition> <definition name="fornitore.modifica" extends="layout"> <put-attribute name="body" value="/WEB-INF/jsp/fornitore/modifica.jsp" /> </definition> </tiles-definitions>
The transition is working, i've also tried to evaluate a service inside the "modifica" transition and it work.Code:<form:form id="form1" action="${webAppPrefix}${flowExecutionUrl}" > <input id="enterFornitoreModify" name="_eventId_modifica" value="Modifica" type="submit" class="submit_b" /> <script type="text/javascript"> Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'enterFornitoreModify', event:'onclick',formId:'form1'})); </script> </form:form>
Without the decoration all work perfect. With the decoration nothings happens. The request start but nothing render, the page stay the same of the call.
Someone can help?
Thanks


Reply With Quote

