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