selectItem旁边的JSF inputText

时间:2012-08-08 07:29:57

标签: jsf primefaces

我想在f:selectItem旁边显示p:inputText并得到如下图所示的结果: enter image description here

用我的代码:

<p:selectManyCheckbox id="s1" value="#{myBean.selectedValues}" layout="pageDirection" >
    <f:selectItem itemLabel="value 1" itemValue="v1" />
    <f:selectItem itemLabel="value 2" itemValue="v2" />
    <f:selectItem itemLabel="value 3" itemValue="v3" />
    <p:inputText id="input1" value="#{myBean.input1Value}" />

</p:selectManyCheckbox>

inputText已在selectItems:

之前显示

enter image description here

我试过把inputText放到selectItem标签中,但结果是一样的。

<f:selectItem itemLabel="value 3" itemValue="v3">
    <p:inputText id="input1" value="#{myBean.input1Value}" />
</f:selectItem>

1 个答案:

答案 0 :(得分:0)

最简单的方法是将p:panelGridcolumns="2"

一起使用
<p:panelGrid columns="2">  
    <p:selectManyCheckbox....
    </p:selectManyCheckbox>
    <p:inputText id="input1" value="#{myBean.input1Value}" />
</p:panelGrid>  

查看其他示例Primefaces PanelGrid

相关问题