how to name the address

I have a customer entry page. For the customer, he has two kinds of contacts: business and home. I have created CustomerData object which includes both business contact and home contact. Both business and home contact are type of ContactData object. In the ContactData object, it includes information like address, city, state, etc. Then on the entry page, I need to have the entry for both the business and home contact. I have something like the following:

<h:inputText id="firstName" value="#{customerData.businessContact.firstName}"/>

and

<h:inputText id="firstName" value="#{customerData.homeContact.firstName}"/>.

In the faces-config file, I have the following:

<managed-bean>

<managed-bean-name>contactData</managed-bean-name>

<managed-bean-class>com.testjsf.ContactData</managed-bean-class>

<managed-bean-scope>request</managed-bean-scope>

</managed-bean>

<managed-bean>

<managed-bean-name>customerData</managed-bean-name>

<managed-bean-class>com.testjsf.LeadData</managed-bean-class>

<managed-bean-scope>request</managed-bean-scope>

<managed-property>

<property-name>businessContact</property-name>

<value>#{contactData}</value>

</managed-property>

<managed-property>

<property-name>homeContact</property-name>

<value>#{contactData}</value>

</managed-property>

</managed-bean>

But it did not work. It gave me error for the duplicate component Id for the firstName. How do I handle this? Any help is appreciated.

Thanks!

Jen

[1774 byte] By [zfan00a] at [2007-11-27 6:05:00]
# 1
Just assign each another ID.
BalusCa at 2007-7-12 16:50:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...