2012-08-08 64 views
0

我想顯示號碼:inputText的旁邊F:選擇信息並獲取導致像下面的圖片: enter image description hereJSF的inputText旁邊選擇信息

我的代碼:

<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標籤,但資源ult是一樣的。

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

回答

0

最簡單的方法是使用p:panelGridcolumns="2"

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

看看其他例子Primefaces PanelGrid