> Actually I am thinking more along the lines of a filter. The probelm 
> is that I need a way to let the NavigationHandler take over for an 
> *original* request. 
> 

The FacesContext would be avaiable in a registered preprocess or postprocess 
chain command.  
Maybe a pre or post command could add a default Status to session scope, 
mocking the DialogNavigation.getStatus().  
This might simulate being engaged in a dialog.  I believe that the dialog 
begins in reaction to invoking the navigation handler
and it is only invoked to respond to an action command.

> Two use cases where this would apply: 
> 
> 1.) First page of the website needs to be a dialog 
> 
> 2.) You want to open the dialog in a popup window but you need to 
> control dimensions, scrollbar, etc. (so a blank target won't work.)

The action invoked in the popup would have to trigger a dialog status.  I see 
what you mean about the popup now.  The page prior to the popup dialog couldn't 
participate if a commandLink was not invoked. 
> 
> I could write my own filter but this strikes me as something others 
> might want as well. That is, the ability to invoke a 
> NavigationHandler based on a URL pattern so that you can initiate a 
> Dialog (or any other custom process) without requiring the use of 
> commandButton or commandLink. 
> 
> My thinking is that we could modify ShaleApplicationFilter (or perhaps 
> the command chain used by it) so that if the URL contains 'launch:' it 
> will strip 'launch:foo:xxx' from the String and then ask the 
> NavigationHandler to handleNavigation using the String 'foo:xxx'. So 
> if you wanted to launch a dialog (xxx) directly you could use 
> 'launch:dialog:xxx'. 

I'm thinking that the FacesContext wouldn't be created yet.  I wonder if you 
could create a component that performs a redirect or swaps out the view in the 
render phase?  You would have the FacesContext and you could use the 
application to get the default navigation handler.  Something like this:

        ViewHandler vh = context.getApplication().getViewHandler();
        UIViewRoot view = vh.createView(context, viewId);
        context.setViewRoot(view);
        context.responseComplete();    

        NavigationHandler nh = context.getApplication().getNavigationHandler();
        nh.handleNavigation(conext, null, getNextDialogProperty());


Gary

> 
> sean 
> 
> ps. Enjoy your vacation (and self-imposed break from your computer) 
> 
> On 5/17/05, Craig McClanahan wrote: 
> > On 5/17/05, Sean Schofield wrote: 
> > > One idea might be to have a filter. I could look for a special 
> > > pattern like "launch:dialog:xxx." If the requested URL contains that 
> > > pattern the filter could ask the NavigationHandler to handleNavigation 
> > > for "dialog:xxx." I think that would work. 
> > 
> > That should work -- on most of the extension points JSF supports the 
> > "decorator pattern" of chaining implementations together, so you can 
> > define your custom NavigationHandler to handle your special case, and 
> > delegate everything else. 
> > 
> > > 
> > > sean 
> > > 
> > 
> > Craig 
> > 
> > PS: By the way ... don't look for any mail from me for the next week 
> > or so ... off on vacation with no computer (gulp! err, i mean phew! 
> > :-). 
> > 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 

Reply via email to