user2462959
user2462959

Reputation: 75

JSF2.0 component binding at run time

I want to create a JSF2.0 applicaton where in I will know the property value at run time.

how to code the

<h:inputText value = "#{dynamic selection}" />

I will get the binding value from database during run time is there any way to do this

Upvotes: 0

Views: 100

Answers (2)

Omar
Omar

Reputation: 1440

You can get the properties' values of your EJB Entity mapped in your database and injected in your managed bean, at run time by :

<h:inputText value="#{yourBean.yourEJBEntity.yourProperty}" />

Upvotes: 0

LaurentG
LaurentG

Reputation: 11807

You could use the brace notation to access the property:

<h:inputText value="#{myBean[myProperty]}" />

See more example and explantation in the EL tag wiki page (under Brace notation).

Upvotes: 2

Related Questions