我有一个 xhtml 文件。当我放置一个 id=a 的命令按钮时,我的表单很混乱。如果我想在 oneRow 中放置 outPutLabe、autoComplete 和 commandButton 是什么?我想在第一行放置三个组件,然后将每个两个组件放置在单独的行中。
<h:form id="frm">
<p:messages globalOnly="false" styleClass="error" autoUpdate="true" id="msgDiseaseHistory"/>
<p:outputPanel id="PanleId">
<h:panelGrid columns="3">
<h:panelGroup>
<fieldset>
<legend>History:</legend>
<h:panelGrid id="Grid" columnClasses="label,component,required"
columns="2">
<p:outputLabel for="EMRName" value="Name:"/>
<p:autoComplete id="EMRName"
value="#{record.dermatology}"
completeMethod="#{record.complete}"
/>
<p:commandButton id="a" value="+"
action="#{record.add}"
onclick="PF('addDlg').show();"/>
<p:outputLabel for="date" value="StartDate:"/>
<p:calendar id="date"
value="#{record.date}"
pattern="yyyy-MMM-dd"
converter="dateConverter"/>
<p:outputLabel for="duration" value="Duration:"/>
<p:inputText id="duration"
value="#{record.duration}"/>
<p:outputLabel for="description" value="Description:"/>
<p:inputTextarea id="description"
value="#{record.description}"/>
</h:panelGrid>
</fieldset>
</h:panelGroup>
<h:panelGroup>
<fieldset>
<legend>Disease:</legend>
<h:panelGrid id="diseaseGrid" columnClasses="label,component,required"
columns="2">
<p:outputLabel for="diseaseName" value="Name:"/>
<p:inputText id="diseaseName"
value="#{record.disease}"/>
<p:outputLabel for="historyDate" value="StartDate:"/>
<p:calendar id="historyDate"
pattern="yyyy-MMM-dd"
converter="dateConverter"
value="#{record.diseaseDate}"/>
<p:outputLabel for="EMRBeanDiseaseHistoryDuration" value="Duration:"/>
<p:inputText id="history"
value="#{record.diseaseDuration}"/>
<p:outputLabel for="Efrg" value="Description:"/>
<p:inputTextarea id="Efrg"
value="#{record.diseaseDescription}"/>
</h:panelGrid>
</fieldset>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid columns="2">
<h:panelGroup>
<fieldset>
<legend>Family:</legend>
<h:panelGrid id="FamilyHistoryGrid" columnClasses="label,component,required"
columns="2">
<p:outputLabel for="historyName" value="Description:"/>
<p:inputTextarea id="historyName"
value="#{record.tree}"/>
</h:panelGrid>
</fieldset>
</h:panelGroup>
<h:panelGroup>
<fieldset>
<legend>Family:</legend>
<h:panelGrid id="familyGrid" columnClasses="label,component,required"
columns="2">
<p:outputLabel for="family" value="Description:"/>
<p:inputTextarea id="family"
value="#{record.family}"/>
</h:panelGrid>
</fieldset>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid id="buttonsGrid" columnClasses="label,component,required" columns="2">
<h:panelGroup>
<p:commandButton value="Save" action="#{record.save}"
update=":create"
oncomplete="if(!args.validationFailed && args.saved )PF('HistoryDlg').hide();"
ajax="true"
/>
</h:panelGroup>
<h:outputText/>
</h:panelGrid>
</p:outputPanel>
</h:form>