jsf - Why did ajax break when sub forms are loaded in a c:forEach block? -
i found strange behavior using jsf 2.0 , ajax functionality. ajax seems no longer work if subpage loaded in c:foreach block.
i using main form includes set of subpages dynamically (based on backend configuration):
<c:foreach items="#{workflowcontroller.editorsections}" var="section"> <div class="imixs-portlet" > <ui:include src="/pages/workitems/parts/#{section.url}.xhtml"/> </div> </c:foreach>
in case not possible use simple f:ajax render"..." tags.
for example following code snippet work first subpage included in c:foreach tag :
<h:commandbutton value="welcome me"> <f:ajax execute="name" render="output" /> </h:commandbutton> <h:outputtext id="output" value="#{childworkitemcontroller.name}" />
if try use f:ajax in subpage included after first subpage, in subpage ajax no longer work.
so working solution skip c:foreach block , include subpages manually.
why did ajax behavior breaks when subpages included in c:foreach block?
the problem did not use ui:composition tag subpages.
this structure of subpage before
<f:subview xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:fn="http://java.sun.com/jsp/jstl/functions" id="mysubpage"> <h:panelgroup layout="block" styleclass="imixs-form-section" id="minutes_body" binding="#{minutesbody}"> .... </f:subview>
after changed ui:composition working!
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> <h:panelgroup layout="block" styleclass="imixs-form-section" id="minutes_body" binding="#{minutesbody}"> .... </ui:composition>
with thie ui:composition tag subpages can included in situation , ajax working expected. in 1 situation still necessary surround part of subpage f:subview element. otherwise got alert box message:
malformedxml: during update: workitem_form:form_panel:j_idt179 not found
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> <!-- subview tag necessary here --> <f:subview> <!-- minutes body --> <h:panelgroup layout="block" styleclass="imixs-form-section" id="minutes_body" binding="#{minutesbody}"> ..... </f:subview> </ui:composition>
Comments
Post a Comment