Hello Community,
I am trying to launch an error dialog programmatically, but the arguments of
requestContext.launchDialog won't work - did something change here? I was
following the tutorial on
http://myfaces.apache.org/trinidad/devguide/dialogs.html#Manually%20Launching%20A%20Dialog
but instead of null for the parameter I would like to provide the exception.
public void launchErrorDialog(Exception pException) {
FacesContext ctx = FacesContext.getCurrentInstance();
ViewHandler viewHandler = ctx.getApplication().getViewHandler();
UIViewRoot dialog = viewHandler.createView(ctx, "/error.jspx");
Map windowProperties = new HashMap();
windowProperties.put("width", new Integer(300));
windowProperties.put("height", new Integer(200));
Map dialogParameters = new HashMap();
dialogParameters.put("exception", pException);
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.launchDialog(dialog,
null, // not launched from any component
dialogParameters, // dialog parameters - this doesn't work! - it
expects UIComponent here, but on the tutorial it expects a map.
true, // show it in a dialog
windowProperties // width and height
);
}
Thanks!
Tobias Eisenträger