[jboss-user] [JBoss Seam] - Multiple injection of the same type
braddm7
do-not-reply at jboss.com
Thu Aug 30 11:24:05 EDT 2007
Hello
I have been struggling for two days but still do not find the answer. Imagine the following scenario:
--- EJB ----
...
@Stateful
@Scope(SESSION)
@Name("testDataBindingManager")
public class TestDataBindingAction implements TestDataBinding {
@In(value="suppAddress", required=false) private TestAddress suppAddress;
@In(value="buyAddress", required=false) private TestAddress buyAddress;
...
--- EJB Entity ----
@Entity
@Name("address")
public class TestAddress {
...
--- EJB Entity ----
--- A Part of Facelet ----
<h:form id="supplierAddressForm">
ID : <h:inputText value="#{suppAddress.id}" />
City : <h:inputText value="#{suppAddress.cityName}" />
TEST : <h:commandButton value="Add New Supplier Address" action="#{testDataBindingManager.addNewSupplierAddress}" />
</h:form>
<h:form id="buyerAddressForm">
ID : <h:inputText value="#{buyAddress.id}" />
City : <h:inputText value="#{buyAddress.cityName}" />
GO : <h:commandButton value="Add New Buyer Address" action="#{testDataBindingManager.addNewSupplierAddress}" />
</h:form>
...
Here both @In properties of type TestAddress are neither being injected. In the case I use only one with the exact same name as the entity @Name("address") works fine.
Please give me a clue how to make it work with both being injected in case not at the same time and another case not at the same time(if possible).
I am really stuck :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079668#4079668
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079668
More information about the jboss-user
mailing list