Java Reference
In-Depth Information
</ui:define>
</ui:composition>
</h:body>
</html>
Navigation to other nodes within a flow can occur normally, by simply placing the name of the node that
you want to navigate to next within the action attribute of a command component. Optionally, navigation can be
definition within the flow configuration, via either code or XML. We will discuss navigation more in the following
sections. The next lines of code show you what intermediateFlow.xhtml looks like.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd " >
<html xmlns=" http://www.w3.org/1999/xhtml "
xmlns:f=" http://xmlns.jcp.org/jsf/core "
xmlns:h=" http://xmlns.jcp.org/jsf/html "
xmlns:ui=" http://xmlns.jcp.org/jsf/facelets " >
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Faces Flow Example #1 - Second Page in Flow</title>
</h:head>
<h:body>
<ui:composition template="../layout/custom_template.xhtml">
<ui:define name="content">
<h:form prependId="false">
<p>
This is the intermediate view of the flow.
<br/>
<h:commandLink value="Go to another final view in flow" action="endingFlow"/>
<br/>
<h:commandLink value="Go to first view in the flow" action="exampleFlow"/>
<br/>
<h:commandLink value="Exit Flow" action="/index"/>
</p>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
To determine when a flow will exit, either navigate to a view that resides outside of the flow using standard JSF
navigation or specify an element entitled <faces-flow-return> in the flow definition. This <faces-flow-return>
element can contain a <navigation-case> that will lead to the exit of the flow. For example, the following demonstrates
a single exit navigational case for a flow:
<faces-flow-return id="intermediateFlow">
<navigation-case>
<from-outcome>nextViewNode</from-outcome>
</navigation-case>
</faces-flow-return>
 
Search WWH ::




Custom Search