How to pass JSF EL parameter between custom tag and custom Component
843842Feb 13 2004 — edited Feb 25 2004I have a custom tag (MYTAG) and corresponding custom component (MYCOMP).
The custom tag takes a parameter , say myParam. This parameter can be either JSF EL or just static.
In the CUSTOM TAG I am doing..
if(isValueReference(myParam) //JSF-EL
{
ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding(myParam);
MYCOMP.setValueBinding("myParam",vb);
}
else
MYCOMP.setParam(myParam);
In the CUSTOM COMP I actually need this parameter to add some Javascript code to it and then assign it to onMousedown . But I am not able to get this parameter if this is JSF EL... How can I get it...
In CUSTOM COMP I do...
//////////////////////////////////////////////
//THIS WILL WORK IF myParam IS STATIC. IF THIS IS JSF EL HOW DO I GET THE EVALUATED VALUE?
public void encodeBegin(FacesContext context) throws IOException {
if(myParam == null)
String onMousedown = this.getAttributes.get("myParam") + Javascript;
else
String onMousedown = myParam + Javascript;
this.getAttributes().put("onmousedown", onMousedown);
super.encodeBegin(context);
}
//////////////////////////////////////////////