【发布时间】:2013-11-07 09:30:59
【问题描述】:
我正在处理 JSF primefaces,因为我在提交表单时遇到问题
问题描述:
我正在使用 primefaces tapView 面板,因为每次点击我都有一组带有 submitButton 的输入字段,我设置所有字段都是强制性的,如果我输入值一个 tap(tap1) 字段并给出提交意味着操作是没有被触发,原因是因为我设置了其他的 tap(tap2) field are强制,所以表单没有被提交。
我的 JSF 代码:
<h:form>
<p:tabView >
<p:tab id="tap1" title="Tap1">
<h:panelGrid>
<h:panelGroup id="ip_leave">
<h:outputText value="From" styleClass="op1" style="margin-right:10px;" />
<p:calendar pattern="dd/MM/yyyy" effect="drop" value="#{leavehistory.leaveFrom}" required="true" size="10"/>
<h:outputText value="To" styleClass="op1" style="margin-left:40px;margin-right:10px;"/>
<p:calendar pattern="dd/MM/yyyy" effect="drop" value="#{leavehistory.leaveTo}" required="true" size="10"/>
<p:commandButton value="Get" actionListener="#{leavehistory.submitLeaveHistory}" update="tap1" style="margin-left:40px;" />
</h:panelGroup>
</h:panelGrid>
</p:tab>
<p:tab id="tap2" title="Tap2">
<h:panelGrid id="ip_reject">
<h:panelGroup >
<h:outputText value="From" styleClass="op1" style="margin-right:10px;" />
<p:calendar pattern="dd/MM/yyyy" effect="drop" value="#{leavehistory.rDateFrom}" required="true" size="10"/>
<h:outputText value="To" styleClass="op1" style="margin-left:40px;margin-right:10px;"/>
<p:calendar pattern="dd/MM/yyyy" effect="drop" value="#{leavehistory.rDateTo}" required="true" size="10"/>
<p:commandButton value="Get" actionListener="#{leavehistory.submitRejectedLeaveHistory}" update="tap2" style="margin-left:40px;" />
</h:panelGroup>
</h:panelGrid>
</p:tab>
</p:tabView>
我的问题是如何一键提交部分字段?
更新:
终于在commandButton中添加process属性
<p:commandButton value="Get" actionListener="#{leavehistory.submitLeaveHistory}" update="tap1" style="margin-left:40px;" />
【问题讨论】:
标签: jsf primefaces form-submit