Danijel
Danijel

Reputation: 8606

Pass argument to a backing bean constructor?

Would it be possible to pass argument to a backing bean constructor?

<p:selectOneMenu value="#{WatchfolderEditBean.classifiedObject.servergroupId}">
   <f:selectItems value="#{ServerGroupMgmtBean( false ).objectsAsListItems}" />
</p:selectOneMenu></td>

In this case ServerGroupMgmtBean( false ) should execute a constructor that takes boolean as argument,however, this doesn't seem to work. Any idea?

Upvotes: 1

Views: 983

Answers (1)

BalusC
BalusC

Reputation: 1108722

This is not supported according EL specification and does also not make any sense according Javabeans specification which EL is relying upon.

Just subclass the bean or pass it as getter method argument if you really need to.

Upvotes: 4

Related Questions