Rahul Akolkar wrote:
On 1/25/07, Paul Spencer <[EMAIL PROTECTED]> wrote:
<snip>
Thanks for taking time to draw this out, heres the body of the
untested addVendor.xml file (I've folded most of the view IDs into the
state IDs but its possible to use <shale:view/> custom action if we
don't want to):
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
xmlns:shale="http://shale.apache.org/dialog-scxml"
initialstate="editVendor_1">
<state id="editVendor_1">
<transition event="faces.outcome" cond="${outcome eq 'success'}"
target="editVendor_2" />
<transition event="faces.outcome" cond="${outcome eq 'cancel'}"
target="end" />
</state>
<state id="editVendor_2">
<transition event="faces.outcome" cond="${outcome eq 'success'}"
target="save" />
<transition event="faces.outcome" cond="${outcome eq 'cancel'}"
target="end" />
</state>
<state id="save">
<transition event="faces.outcome" cond="${outcome eq 'success'}"
target="end" />
<transition event="faces.outcome" cond="${outcome eq 'failure'}"
target="editVendor_1" />
</state>
<state id="end" final="true">
<!-- MBs specified declaratively (such as expr below) have to
return a String, though one may:
(a) discard the return value, or
(b) use a DialogContextListener to invoke procedural bits
instead-->
<onentry>
<var expr="#{vendorManager.listAllVendors}" name="discard"/>
<shale:view viewId="/foo"/> <!-- Lets say we want to end at /foo -->
</onentry>
</state>
</scxml>
Note that we did not use faces-config navigation here, which is
probably for the good since the entire page flow for this task is now
captured in this model.
Where does the code you mentioned below go and how is it called?
<snip/>
As mentioned above, that would be inside the method called by the MB,
if at all we wanted to stop an active dialog and delegate to the
faces-config navigation.
What is the name of the method, or where do I configure it, that is
called when the outcome, does is not configured?
In the above example page's header/footer define the outcomes "home",
"logout", and "menu". These outcomes are currently handled by
faces-config.xml, and I agree with your statement about avoiding the
modeling of "global" site navigation in each dialog.
-Rahul
Paul Spencer