0
<h:outputLabel value="#{bundle.CreateCustomerLabel_email}" for="email" /> 
<h:inputText id="email" value="#{customerController.selected.email}" title="#{bundle.CreateCustomerTitle_email}" /> 

<h:outputLabel value="Address:" for="addressId.address" /> 
<h:inputText size="30" id="address" value="#{customerController.selected.addressId.address}" title="Address" >
</h:inputText>

在 Cutomer Entity bean 中,我有:

@JoinColumn(name = "address_id", referencedColumnName = "address_id")
@ManyToOne(optional = true, cascade={CascadeType.ALL})
private Address addressId;

在地址实体 bean 中,我有:

Basic(optional = true)
@NotNull
@Size(min = 1, max = 50)
@Column(name = "address")
private String address;

问题:如何在 JSF 2.0 表单中使用嵌套属性?我应该实现嵌套表单还是如何实现?

提前致谢!萨米人

4

1 回答 1

0

您有获取 addressId 和地址的方法吗?第二个 Label 中的for属性必须是for="address"

于 2012-02-25T11:11:58.560 回答