Ok. The basic approach is that prior to the page being rendered you’ll create instances of the UIParameter, configure them and add them to the jsf component tree as children of your applet.
The easiest way to add a child to the applet (or any component) to create a control accessor for your applet. Right click on your applet in the canvas, and select Create Control Accessor. This will create a java method like:
/**
* Getter method for the control with id='defaultForm:applet'
*/
public com.webmethods.caf.faces.component.output.Applet getApplet() {
return (com.webmethods.caf.faces.component.output.Applet)findComponentInRoot("defaultForm:applet");
}
Then, override the beforeRenderResponse() and do the following:
- Get a reference to the applet component (see above)
- Clear out any previous children of the applet
- Fetch your dynamic params (custom business logic)
- For each dyanmic param, create a UIParam and add it to the child list of the applet
as in the following:
@Override
protected void beforeRenderResponse() {
super.beforeRenderResponse();
//clear old children from previous request
Applet applet = getApplet();
List<UIComponent> children = applet.getChildren();
children.clear();
//get params from somewhere
UIParameter p1 = new UIParameter();
p1.setName("p1");
p1.setValue("v1");
children.add(p1);
}
Hope this helps.
–mark
#MWS-CAF-Task-Engine#webMethods#webMethods-BPMS