users@javaserverfaces.java.net

RE: I am stumped on how to move from Application.createValueBinding to ExpressionFactory.createValueExpression

From: Jason Lee <lee_at_iecokc.com>
Date: Wed, 17 Jan 2007 14:46:54 -0600

Are you trying to register a variable that components can then
reference, like the var attribute on a dataTable? If so, try this:

ELContext ec = FacesContext.getCurrentInstance().getELContext();
ELResolver er = ec.getELResolver();
er.setValue(ec, null, "foo", valueOfFoo);

-----
Jason Lee, SCJP
Programmer/Analyst
http://www.iec-okc.com
 

> -----Original Message-----
> From: Todd Patrick [mailto:Todd.Patrick_at_dtn.com]
> Sent: Wednesday, January 17, 2007 2:40 PM
> To: users_at_javaserverfaces.dev.java.net
> Subject: I am stumped on how to move from
> Application.createValueBinding to
> ExpressionFactory.createValueExpression
>
> I am looking at two APIs:
>
> http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.
> html?javax
> /faces/application/Application.html
>
> http://java.sun.com/javaee/5/docs/api/
>
>
> Looking at the documentation I need to go from:
>
> Visit visit = new Visit();
> facesContext.getApplication().createValueBinding("#{" +
> Constants.VISIT_KEY_SCOPE + Constants.VISIT_KEY +
> "}").setValue(facesContext, visit);
>
>
> To the JSF 1.2 requirement:
>
> ELContext elcontext = facesContext.getELContext();
> facesContext.getApplication().getExpressionFactory().createMet
> hodExpress
> ion(elcontext, "#{" + Constants.VISIT_KEY_SCOPE +
> Constants.VISIT_KEY + "}", String.class, new Class<?>[0]);
>
>
> The createMethodExpression method has be stumped at the moment.
>
> How do I get my visit object into the value of the expression
> (second parameter in createMethodExpression)?
>
> Thanks,
>
> --Todd
>
>
> -----------------------------------------
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized use, disclosure or distribution
> is prohibited. If you are not the intended recipient, please
> contact the sender by reply email and destroy all copies of
> the original message.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail:
> users-help_at_javaserverfaces.dev.java.net
>
>