matthias
matthias

Reputation: 2062

Multiple @ManagedProperty of same Type

I have a manged bean where I use another managed bean:

@ManagedProperty(value="#{tableActions}") 
private TableActions table1;    

that works fine.

Now I need to use another instance of it:

@ManagedProperty(value="#{tableActions}") 
private TableActions table1;    

@ManagedProperty(value="#{tableActions}") 
private TableActions table2;    

However, now table2 is the same as table1. How can I create a separate instance?

Upvotes: 1

Views: 132

Answers (1)

BalusC
BalusC

Reputation: 1109635

Make it a @NoneScoped bean.

You only need to make sure you access it in view via #{yourParentBean.table1} and not via #{tableActions}.

See also:

Upvotes: 2

Related Questions