HTML and CSS Reference
In-Depth Information
Listing 5-17.
Flow Definition in XML
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml
"
xmlns:f="
http://java.sun.com/jsf/core
"
xmlns:j="
http://java.sun.com/jsf/flow
"
>
<f:metadata>
<j:faces-flow-definition id="newEntryFlow">
<!-- Method to execute when the flow is initialized -->
<j:initializer>#{addressBook.newEntry}</j:initializer>
<!-- Specifies the first node of the flow -->
<j:start-node>newEntryStart</j:start-node>
<!-- Using a switch you can dynamically determine the next node -->
<j:switch id="newEntryStart">
<!-- Go to newEntryHelp if this is the first time the user
is using the wizard -->
<j:navigation-case>
<j:if>#{addressBook.newEntryFirstTime}</j:if>
<j:from-outcome>newEntryHelp</j:from-outcome>
</j:navigation-case>
<!-- Go to basicDetails if this is not the first time that
the user has used the wizard -->
<j:navigation-case>
<j:if>#{!addressBook.newEntryFirstTime}</j:if>
<j:from-outcome>basicDetails</j:from-outcome>
</j:navigation-case>
</j:switch>
<j:view id="newEntryHelp">
<j:vdl-document>newEntryHelp.xhtml</j:vdl-document>
</j:view>
<j:view id="basicDetails">
<j:vdl-document>create-entry-1.xhtml</j:vdl-document>
</j:view>
<j:view id="contactDetails">
<j:vdl-document>create-entry-2.xhtml</j:vdl-document>
</j:view>
<j:view id="contactPhoto">
<j:vdl-document>create-entry-3.xhtml</j:vdl-document>
</j:view>