Rahul,
I do not completely follow you answer.

Assume the following:

1) stateId = "start"
   Display the view /editVendor_1

   Outcome    Next state
   --------   -----------
   success    page2
   cancel     end

2) stateId = "page2"
   Display the view /editVendor_2

   Outcome    Next state
   --------   -----------
   success    save
   cancel     end

3) stateId = "save"
   Execute the action #{vendorDialog.save}

   Outcome    Next state
   --------   -----------
   success    end
   failure    start

4) End state stateId = "end"
   Execute the action #{vendorManager.listAllVendors}.  faces-config.xml
   will take over form here.

5) dialog-config.xml
<dialogs>
  <dialog name="addVendor" scxmlconfig="dialogs/addVendor.xml"
    dataclassname="com.foo.Vendor" />
</dialogs>

6) Using Shale 1.0.4


What does the dialog's scxml file look like?

Where does the code you mentioned below go and how is it called?


Paul Spencer

Rahul Akolkar wrote:
On 1/25/07, Paul Spencer <[EMAIL PROTECTED]> wrote:
I have a dialog that adds a vendor. If the dialog successfully add the
vendor, or the dialog is canceled, then I want to end the dialog with a
call to the action #{vendorManager.listAllVendors}.  The view to display
upon the completion of the action is configured in faces-config.xml.
How to do I configure this ?

<snip/>

For v1.0.4, this requires a bit of knowledge of the internals (the
recent DialogHelper addition to trunk really simplifies this ;-).
Knowing that the active DialogContext is stored as a request-scoped
attribute with key Constants.CONTEXT_BEAN, its possible to end the
dialog like so:

<code>

DialogContext dcontext = (DialogContext)
FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get(Constants.CONTEXT_BEAN);

dcontext.stop();

</code>

You can guard the stop() with a not null and isActive() predicate, if
deemed necessary. The good thing is this will also do the necessary
book-keeping cleanup associated with the DialogContextManager for you.
Assumes the view displayed (via the faces-config nav rule) is not part
of any dialog at that point.

-Rahul


Paul Spencer



Reply via email to