JSF组件关闭表单元格
我试图在一个h:panelGrid组件中嵌套一个表,而h:selectOneMenu关闭了它出现的单元格并创建了一个新的(不需要的)行,从而破坏了格式 我的代码如下所示:JSF组件关闭表单元格,jsf,Jsf,我试图在一个h:panelGrid组件中嵌套一个表,而h:selectOneMenu关闭了它出现的单元格并创建了一个新的(不需要的)行,从而破坏了格式 我的代码如下所示: <h:panelGrid columns="2"> [Other rows that work just fine] <h:outputText value="Match [Stuff] to [More Stuff]:" /> <table> <
<h:panelGrid columns="2">
[Other rows that work just fine]
<h:outputText value="Match [Stuff] to [More Stuff]:" />
<table>
<tr>
<th>[Stuff]</th>
<th>[More Stuff]</th>
</tr>
<tr>
<td>
<h:outputText value="Manually Created First Element of Stuff" />
</td>
<td>
<h:selectOneMenu value="#{bean.moreStuffSetting}">
<f:selectItem itemLabel="--None--" itemValue="" />
<f:selectItem itemLabel="Manual First Choice" itemValue="manual" />
<f:selectItems
value="#{bean.listOfMoreStuff}"
var="moreStuff"
itemLabel="#{moreStuff.name}"
itemValue="#{moreStuff.value}" />
</h:selectOneMenu>
</td>
</tr>
<ui:repeat value="#{bean.listOfStuff}" var="stuff">
<tr>
<td>
<h:outputText value="#{stuff.name}" />
</td>
<td>
<h:selectOneMenu value="#{bean.moreStuffSetting}">
<f:selectItem itemLabel="--None--" itemValue="" />
<f:selectItem itemLabel="Manual First Choice" itemValue="manual" />
<f:selectItems
value="#{bean.listOfMoreStuff}"
var="moreStuff"
itemLabel="#{moreStuff.name}"
itemValue="#{moreStuff.value}" />
</h:selectOneMenu>
</td>
</tr>
</ui:repeat>
</table>
</h:panelGrid>
[其他行工作正常]
[材料]
[更多信息]
第一个h:selectOneMenu元素出现问题。(ui:repeat中的h:selectOneMenu元素正在做我期望的事情。)我期望“手动创建的第一个元素”和该下拉列表显示为同一行中的两个单元格。但是,这是生成的HTML中显示的内容:
<tr>
<td>Manually Created First Element of Stuff</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td><select...
手动创建了Stuff的第一个元素
选择JSF组件树中的第一个同级来启动一个新的表单元。您在那里看到的普通HTML
元素不是JSF组件
用
包装它
...
另一种方法是只使用
<tr>
<td>[Label I'm expecting]
</td>
<td><select...
<h:panelGrid columns="2">
<h:outputText value="Match [Stuff] to [More Stuff]:" />
<h:panelGroup>
<table>
...
</table>
</h:panelGroup>
</h:panelGrid>