Jdev版本:11.1.1.7
我从 Java bean 创建了数据控件。我用数据控件属性绑定了一个 jspx 页面。
在那个页面中,我动态地创建了组件(forEach 循环)。
问题是仅创建(增加)组件,但绑定值没有不同。
代码:
豆:
public class ProposalBean
{
private String name;
private String age;
public ProposalBean()
{
super();
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setAge(String age)
{
this.age = age;
}
public String getAge()
{
return age;
}
}
JSPX:
<af:form id="f1">
<af:panelGroupLayout id="pgl1">
<af:panelTabbed id="pt1">
<af:forEach var="var" varStatus="vs" begin="1" end="3">
<af:showDetailItem text="Tab #{vs.index}" id="sdi1">
<af:inputText value="#{bindings.name.inputValue}"
label="#{bindings.name.hints.label}"
required="#{bindings.name.hints.mandatory}"
columns="#{bindings.name.hints.displayWidth}"
maximumLength="#{bindings.name.hints.precision}"
shortDesc="#{bindings.name.hints.tooltip}"
id="it1">
<f:validator binding="#{bindings.name.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.age.inputValue}"
label="#{bindings.age.hints.label}"
required="#{bindings.age.hints.mandatory}"
columns="#{bindings.age.hints.displayWidth}"
maximumLength="#{bindings.age.hints.precision}"
shortDesc="#{bindings.age.hints.tooltip}"
id="it2">
<f:validator binding="#{bindings.age.validator}"/>
</af:inputText>
</af:showDetailItem>
</af:forEach>
</af:panelTabbed>
<af:commandButton text="submit" id="cb1" action="next"/>
</af:panelGroupLayout>
</af:form>
注意:在 forEach 循环结束是动态的。