Hallo,

can anyone provide me with an example how to implement a
DialogRenderKitService that emulates the default behaviour hidden in
DialogServiceImpl.

I expected the implementation to be like this:

public boolean launchDialog(FacesContext context, UIViewRoot targetRoot,
                        UIComponent source, Map<String, Object> 
processParameters,
                        boolean useWindow, Map<String, Object> windowProperties)
{
        RequestContext.getCurrentInstance().getDialogService().pushView(
                                context.getViewRoot());
        context.setViewRoot(targetRoot);
        context.renderResponse();

        return true;
}

public boolean returnFromDialog(FacesContext context, Object returnValue)
{
        RequestContext.getCurrentInstance().getDialogService().popView(true);
        context.renderResponse();

        return true;
}

public boolean isReturning(FacesContext context, UIComponent source)
{
        // ???
}

but there are several problems:

1) The page flow scope is automatically popped from the page flow scope
stack after launchDialog has been called and this feature results in an
error popping the view in the returnFromDialog method. (I can work around
this problem if I push a dummy page flow scope on the stack at the end of
the method launchDialog but I hope this is not intended)

2) It is not obvious how to implement isReturning. I don't know how to
determine if I am returning from a dialog. The documentation explains:
"Returns true if the RenderKit is aware that a dialog has returned, and the
given source component was responsible for launching that dialog." But in my
test scenario the source component was the button that closes the dialog and
this button is not identical to the button that launched the dialog!

-- 
View this message in context: 
http://www.nabble.com/-Trinidad--Custom-DialogRenderKitService-tp15933854p15933854.html
Sent from the My Faces - Dev mailing list archive at Nabble.com.

Reply via email to