On 1/24/07, JS Portal Support <[EMAIL PROTECTED]> wrote:

Okay,

For some reason my shale jar's didn't have the DialogContextManager and
DialogContext interfaces in them. I downloaded the latest 1.0.4 ;-) and
that
solved it. Now I can't get to my data anymore without logging in. Jeee!

Is there a problem with the .getVariableResolver() being depreciated by
the
way? What would be the new preferred way?


The issues with using the getVariableResolver() approach are:

* The application is getting involved with the internal "plumbing" of the
 implementation, including depending on the managed beans facility
 to create the manager if it does not exist.

* The application is required to be aware of the key under which the
 DialogContextManager is stored, and what scope it is in.

* Because the knowledge is scattered all over an application, it would
 be essentially impossible to modify the technique inside the framework.

In 1.0.4, the approach I described is the only one that works, and it will
continue to work in later versions.  In the nightly builds, last night I
checked in a helper class that makes life a lot easier:

   public class DialogHelper {

       // Return the active DialogContext (if any)
       public static DialogContext getDialogContext();
       public static DialogContext getDialogContext(FacesContext context);

       // Return the DialogContextManager, creating if needed
       public static DIalogContextManager getDialogContextManager();
       public static DialogContextManager
getDialogContextManager(FacesContext context);

   }

so you end up with very simple calls like:

   DialogContextManager manager = DialogHelper.getDialogContextManager();

with all the implementation details hidden away.

I haven't personally tested whether you can successfully navigate (say, to
>a login page) from the prerender() method.
It works. When a user tries to access without being logged, the
Authenticate
dialog is started from the prerender. But now, how can I make my user
return
to the initial view which started up the Authenticate dialog. The user
gets
logged on but gets to see the logon.jsp once the Authenticate dialog is
done. Is there a way to create a dialog programmatically, like you
described, moving the user to the view on which prerender is called and
then
set the Authenticate as a child so that after authenticate, the user will
be
redirected back to the initial view?


Something along the following lines ought to work:

* In the view that starts the authentication dialog, save the view id in a
 session scope variable.

* At the end of the authentication dialog, execute an action method that
 looks up the saved view id (if any), and navigates programmatically
 instead of using a normal view state.

I hope I'm not too much of a burden using you as a climbing rope on my shale
learning curve ;-)


Nah, it is fun to answer interesting questions :-)

Cheers,
Joost


Craig

Reply via email to