hi, I am trying to implement a4j:include wizard with SWF flow but not able to get the rerender="#{flowRenderFragments}" work. Please help me to make this work.
I have the main page with three tabs as start of the SWF flow.
I have removed the schema definitions from the code to comply with the forum rules.
Code:
<head>
<title>Oversight Administration </title>
</head>
<body>
<f:view>
<rich:tabPanel switchType="client" >
<rich:tab label="Group Management" disabled="true">
Default text - Group Management
</rich:tab>
<rich:tab label="MyGroup Preferences">
<ui:include src="myGroupPreferencesTab.xhtml" />
</rich:tab>
<rich:tab label="My Preferences">
Default text - my Preferences
</rich:tab>
</rich:tabPanel>
</f:view>
</body>
</html>
In the middle tab I have a ui:include page where I am defining the form and the fragment . In this page I have <a4j:include viewId="myGroupBasicinfo.xhtml" /> to implement the first steps of the wizard.
Code:
<ui:composition >
<style type="text/css">
.col1 { vertical-align:top; }
.col2 { vertical-align:top; width:450px; }
.wizard { width:600px; }
.wform td { vertical-align:top; }
.wfcol1 { text-align: right; white-space:nowrap;}
.wfcol2 { }
.wfcol3 { }
.s1row td { height:30px; }
.rich-message { color:red; }
.navPanel {
position:absolute;
bottom:0;
height:23px;
margin:0;
padding:2px;
}
</style>
<br/>
<h:form id="groupWizardForm">
<h:panelGrid width="100%" columns="2" columnClasses="col1,col2">
<a4j:outputPanel styleClass="wizard" id="groupWizardFragment">
<f:facet name="header">
<h:outputText value="MyGroup Preferences" />
</f:facet>
<a4j:include viewId="myGroupBasicinfo.xhtml" />
</a4j:outputPanel>
</h:panelGrid>
</h:form>
<br/>
<ui:debug hotkey="p" rendered="true"/>
<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>
</ui:composition>
In the myGroupBasicinfo.xhtml page I have next and save buttons with rerender="#{flowRenderFragments}"
Code:
<ui:composition >
<div style="position:relative;height:200px">
<h:panelGrid rowClasses="s1row" columns="3" columnClasses="wfcol1,wfcol2,wfcol3">
<h:outputText value="Group name:" />
<h:inputText id="shortName" value="#{oversightGroup.shortName}" required="true" />
<rich:message for="shortName" />
<h:outputText value="Public:" />
<h:selectBooleanCheckbox id="publicFlag" value="#{oversightGroup.publicFlag}" required="false"/>
<rich:message for="publicFlag" />
<h:outputText value="Description" />
<h:inputTextarea id="description" value="#{oversightGroup.description}" rows="5" cols="15" required="false"/>
<rich:message for="description"/>
</h:panelGrid>
<div class="navPanel">
<a4j:commandButton style="float:left" action="next" value="Next >>" reRender="#{flowRenderFragments}"/>
<a4j:commandButton style="float:right" action="save" value="Save" reRender="#{flowRenderFragments}"/>
</div>
</div>
</ui:composition>
I defined flow definition like this..
Code:
<var name="oversightGroup" class="com.jpmchase.oversight.admin.model.OversightGroup" />
<var name="user" class="com.jpmchase.oversight.admin.model.UserProfile" />
<view-state id="adminPanel">
<transition on="next">
<render fragments="groupWizardFragment" />
</transition>
<transition on="save">
<render fragments="xgroupWizardFragment" />
</transition>
</view-state>
<view-state id="myGroupBasicInfo" view="myGroupBasicInfo.xhtml">
<transition on="next" to="myGroupUserManagement">
<render fragments="groupWizardFragment" />
</transition>
<transition on="save">
<render fragments="groupWizardFragment" />
</transition>
</view-state>
...........other views
I am able to get the first step of the flow. but clicking on next or save button is giving an illegalArgumentException groupWizardForm.
Code:
Caused by: java.lang.IllegalArgumentException: groupWizardForm
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:620)
at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:858)
I am quite new in SWF. Please help me to understand where I am doing wrong. Thanks in advance.