RequestContext
provides a useful API for passing parameters from JSF beans support in json format for ajax callbacks such as oncomplete
. Running javascript on the server side and adding components to update programmatically.
Sample code for Backend Bean:
RequestContext context = RequestContext.getCurrentInstance(); if (condition) { context.addCallbackParam("someVariable", true); } else { context.addCallbackParam("someVariable", false); }
We are trying to write a javaScript
function in the interface (xhtml) to handle this callback, for example,
function precautionsDialogShow(xhr, status, args) { if(args.someVariable) { dialogue.show(); } }
source share