2016-09-23 50 views
0

我的页面:---h:panelGrid不一致的单元格分配

某些东西导致panelGrid在几行中创建一个空单元格。

我想有一个可见的两列表,第一列标签,第二列一个inputText元素或带有工具提示的selectMenu。

我的解决方法是,创建一个3列表格,当panelGrid决定不创建一个空单元格时,添加一个<br></br>来提示它这样做。

  <h:panelGrid columns="3" style="text-align:left"> 
       <p:remoteCommand name="startJobActivate" actionListener="#{provisioningBean.startJobActivate}" /> 

       <h:outputLabel for="longitudeIdAct" value="Longitude: " /> 
       <p:inputText id="longitudeIdAct" value="#{provisioningBean.longitude}" title="Longitude" /> 
       <p:watermark for="longitudeIdAct" value="Longitude" /> 

       <h:outputLabel id="equipmentDropMenuActLabel" for="equipmentDropMenuAct" value="#{provisioningBean.accessDeviceLabel}" /> 
       <p:selectOneMenu id="equipmentDropMenuAct" value="#{provisioningBean.equipment}" title="Not needed for CSI or SIP" 
        disabled="#{provisioningBean.equipDisabled}" style="width: 100% !important"> 
        <f:selectItem itemLabel=" Equipment" itemValue="" noSelectionOption="true" /> 
        <f:selectItems value="#{provisioningBean.equipments}" /> 
       </p:selectOneMenu> 
       <p:tooltip for="equipmentDropMenuAct" /> 

       <h:outputLabel for="rangeActId" value="Range: " /> 
       <p:spinner id="rangeActId" value="#{provisioningBean.rangeAct}" min="1" title="Amount of telephone numbers to provide" size="3" 
        disabled="#{provisioningBean.rangeDisabled}" /> 
       <br></br> 
      </h:panelGrid> 

这是一个错误? 我在这里错过了什么?编辑: 哦,整洁!我设法创建一个最小的例子,它仍然有同样的问题:d https://gist.github.com/WurmD/f3cb45669e6871acc77462f34891862f

screenshot - you need 10 rep to post images

所以这是一个3列H:panelGrid的,但第三单元被拉紧东西

EDIT2:同行为与号码:panelGrid的

+0

你可以上传的图像它看起来像什么?如果你使用p:panelGrid?你可以用硬编码文本创建一个更简单的例子,这样我们可以更容易地测试它吗? –

+0

@ JaqenH'ghar:done :) – WurmD

+0

3列意味着在每个第三个元素之后都有一个新的行开始......将不相关的东西移动到panelgrid之外,或者使用'h:panelgroup'对事物进行分组并将面板组计数为1元件 – Kukeltje

回答

0

谢谢Kukeltje对于这样的回答:

H:panelGrid的列= “3” 表示

“每个第三元素之后启动新行”

因此,要么把水印(和其他不可见元素)外H:panelGrid的,或使用H:panelGroup中,以团体的事情,只应在表中占据一个单元格:

<p:remoteCommand name="startJobActivate" actionListener="#{provisioningBean.startJobActivate}" /> 
<p:panelGrid columns="2" style="text-align:left"> 
    <h:outputLabel for="orderIdAct" value="Order Number: *" /> 
    <p:inputText id="orderIdAct" value="#{provisioningBean.orderNumberAct}" label="orderId" title="Order Number" /> 

    <h:outputLabel for="customerNameIdAct" value="Customer: *" /> 
    <h:panelGroup> 
     <!-- h:panelGroup to group things that should only occupy 1 cell in the table --> 
     <p:inputText id="customerNameIdAct" value="#{provisioningBean.customerName}" title="Customer Name" /> 
     <p:watermark for="customerNameIdAct" value="Customer Name" id="watermarkcustomerNameIdAct" /> 
    </h:panelGroup> 

</p:panelGrid> 
<p:panel id="executePanelAct"> 
    <p:commandButton value="Execute Activation" id="actvateButton" update=":form:growl" styleClass="executeButton" /> 
</p:panel> 
<!-- Items that don't need to be in panelGrid --> 
<p:watermark for="orderIdAct" value="Order Number" id="watermarkorderIdAct" /> 
相关问题