Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to pass JSF EL parameter between custom tag and custom Component

843842Feb 13 2004 — edited Feb 25 2004
I 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);
}
//////////////////////////////////////////////
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2004
Added on Feb 13 2004
3 comments
223 views