Madalina
Madalina

Reputation: 1307

get a backing bean property value from another bean

It is possible to access or to get a backing bean property value from another backing bean in JSF?

Upvotes: 0

Views: 1448

Answers (1)

BalusC
BalusC

Reputation: 1108537

Yes, it is possible.

You can access another beans in the context by Application#evaluateExpressionGet(). You can also inject a bean as managed property of other bean in faces-config.xml. If you're already on JSF2, you can even use @ManagedProperty annotation like follows:

@ManagedProperty(value="#{bean}") 
private Bean bean;

Upvotes: 1

Related Questions