代码之家  ›  专栏  ›  技术社区  ›  QA_Col

JSF,项之间的panelGrid空间

  •  0
  • QA_Col  · 技术社区  · 6 年前

    我有这个代码,我想获得左空间(不是文件值)的优势。。。

                [![<h:panelGrid columns="2" cellpadding="5" >
                    <p:outputLabel value="Field1:" for="itField1" />
                    <p:inputText id="itField1" style="width:200px" required="true"
                                 value="#{bean.field1}">
                    </p:inputText>
                    <p:outputLabel value="Field2:" for="itField2" />
                    <h:panelGrid columns="2" style="width:200px"  cellpadding="0" cellspacing="0" >
                        <p:inputText id="itField2" required="true" 
                             value="#{="#{bean.field2}"
                             />
                        <p:commandButton icon="fa fa-search"
                                         />
                    </h:panelGrid>
                    <p:outputLabel value="Field3:" for="itField3" />
                    <p:inputText id="itField3" style="width:200px" required="true"
                                 value="#{bean.field3}">
                    </p:inputText>
                </h:panelGrid>]
    

    我要这个! enter image description here

    但是,我明白了:( enter image description here

    怎么做?

    1 回复  |  直到 6 年前
        1
  •  0
  •   శ్రీ    6 年前

    这可以通过添加 风格 width:100% <p:inputText id="itField2" ..... /> <p:commandButton .... /> 具体如下:

    <p:inputText id="itField2" value="#{bean.field2}" required="true" style="width:100%"  />
    <p:commandButton icon="fa fa-search" style="width:100%" />