voyent
setValueExpression(arg1:String, arg2:ValueExpression):void  XML
Forum Index -> Components
Author Message
jmind

Joined: 07/Jul/2008 00:00:00
Messages: 54
Offline


I want to set the value expression for an HtmlInputText and i found the method above (see title). Unfortunately i haven't found the documentation for this method (nor in j2ee docs not in icefaces docs). I was wondering what the first argument stands for.
Having created a ValueExpression this way:

Code:
ValueExpression exp = factory.createValueExpression(eLContext, "#{managedBean.someProperty}", <SomePropertyType>.class);

with factory being an instance of ExpressionFactory (obtained from Application) and eLContext the result of invoking getELContext() on an instance of FacesContext.

So, now i would like to do this (assuming inputText is an instance of com.icesoft.faces.component.ext.HtmlInputText):

Code:
inputText.setValueExpression("???", exp);


but what have i to replace to the question marks?

regards ;)


italian coder
andy.hoffman

Joined: 11/Sep/2008 00:00:00
Messages: 15
Offline


Question, I'm supposing this is within JSF 1.2? I don't see any mention of setValueExpression within HtmlInputText class within JSF 1.1.
andy.hoffman

Joined: 11/Sep/2008 00:00:00
Messages: 15
Offline


Ahh, found it within UIComponentBase of jsf 1.2.

http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/component/UIComponentBase.html

Looks like the first parameter is for the name of the attribute to which you are binding the expression.

Code:
Parameters:
 name - Name of the attribute or property for which to set a ValueExpression
 binding - The ValueExpression to set, or null to remove any currently set ValueExpression


I'm guessing within the component, this would be one of it's attribute names, such as "value" within HtmlInputText - one of the attributes which can receive an EL binding expression.

Hope that helps.
jmind

Joined: 07/Jul/2008 00:00:00
Messages: 54
Offline


many thanks!

italian coder
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team