Catching back up after vacation -- only 873 Apache email threads to go :-).

On 5/18/05, Sean Schofield <[EMAIL PROTECTED]> wrote:
> 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.
> 
> Two use cases where this would apply:
> 
> 1.) First page of the website needs to be a dialog
> 

One way to deal with this is along the following lines:

* Map the welcome page to a filter that creates the appropriate
  FacesContext for the request (just like what FacesServlet normally
  does to initiate the JSF lifecycle).

* Once the FacesContext has been created:

    String dialogName = ...;
    FacesContext context = FacesContext.getCurrentInstance();
    NavigationHandler nh = context.getApplication().getNavigationHandler();
    nh.handleNavigation("dialog:" + dialogName);
    context.responseComplete();
    return; // i.e. do not follow the rest of the filter chain

This is likely to be a common enough use case that it should be
supported with the presence of an init parameter defining the name of
the initial 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.)
> 
> 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'.

The technique I described above should deal with this, without trying
to get too fancy.  In particular, it doesn't try to make any
assumpations that a View ID is actually a URL (it's not, even in the
standard JSF implementation).

> 
> sean
> 
> ps. Enjoy your vacation (and self-imposed break from your computer)

It was quite nice ... the only disconcerting part was getting on the
plane yesterday in Cabo (~85 degrees) and coming home to Portland (~95
degreees)  :-)

Craig

> 
> On 5/17/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> > On 5/17/05, Sean Schofield <[EMAIL PROTECTED]> 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]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to