Skip to main content

how to use an ELResolver "by hand"?

3 replies [Last post]
autozoom
Offline
Joined: 2006-05-24
Points: 0

I need to do this:
in a JSF table a text component with an attribute like:

text="#{currentRow.value['area'].descr}"

Now I need to use the same expression against an object defined in my java
code

I would like something like
ELResolver.resolve("#{currentRow.value['area'].descr}", "currentRow",
myObject)

to evaluate the expression using myObject for the value of "currentRow"

How can this be achieved? I think it's quite easy, but I cannot find the
right way

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ryan Lubke

webtier@javadesktop.org wrote:
> I need to do this:
> in a JSF table a text component with an attribute like:
>
> text="#{currentRow.value['area'].descr}"
>
> Now I need to use the same expression against an object defined in my java
> code
>
> I would like something like
> ELResolver.resolve("#{currentRow.value['area'].descr}", "currentRow",
> myObject)
>
> to evaluate the expression using myObject for the value of "currentRow"
>
> How can this be achieved? I think it's quite easy, but I cannot find the
> right way
>
You can obtain the ELResolver from the ELContext:

ELResolver resolver =
FacesContext.getCurrentInstance().getELContext().getELResolver();

> [Message sent by forum member 'autozoom' (autozoom)]
>
> http://forums.java.net/jive/thread.jspa?messageID=315975
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

autozoom
Offline
Joined: 2006-05-24
Points: 0

thanks but I already know how to get the ELResolver object
I don't know how to use it
any help appreciated

kchung
Offline
Joined: 2004-05-06
Points: 0

Sounds like you want to set currentRow to myObject. Wouldn't work? Currently ELRsolver does not include the resolve method.

Message was edited by: kchung