2
這是我的形式..Primefaces驗證無法在Form中輸入任何內容後?
<p:panel id="panel" header="Portfolio Transaction">
<p:messages id="msgs" />
<p:panelGrid columns="7" id="transactionPanel" style="display: inline-block;">
<f:facet name="header">
Register New Trade
</f:facet>
<h:outputLabel for="tipsSuggestionBoxId" value="Company Name:*"></h:outputLabel>
<h:outputText value="Date:*" />
<h:outputText value="Type:*" />
<h:outputText value="Quantity:*" />
<h:outputText value="Price:*" />
<h:outputText value="Brokerage:" />
<h:outputText value="Notes:" />
<p:autoComplete id="tipsSuggestionBoxId"
completeMethod="#{portfolioTransactionBean.autoSelectCompany}"
value="#{portfolioTransactionBean.txnCurrentRecord.companyName}"
minChars="3" nothingLabel="No similar company found"
requestDelay="1" minQueryLength="3" required="true"
requiredMessage="Company Name Cannot be empty">
</p:autoComplete>
<p:calendar id="from_date" size="10" required="true"
requiredMessage="Date Cannot be empty"
value="#{portfolioTransactionBean.txnCurrentRecord.umptTransDate}"
mode="popup" showOn="both" pattern="dd/MM/yyyy"
popupIconOnly="true" readonly="#{facesContext.renderResponse}">
</p:calendar>
<p:selectOneMenu id="tranType"
value="#{portfolioTransactionBean.txnCurrentRecord.umptTransType}">
<f:selectItem itemLabel="Transaction Type" itemValue="" />
<f:selectItem itemLabel="Buy" itemValue="Buy" />
<f:selectItem itemLabel="Sell" itemValue="Sell" />
</p:selectOneMenu>
<p:spinner id="transQuntity" required="true"
value="#{portfolioTransactionBean.txnCurrentRecord.umptQty}" min="1" label="Quanity" size="5"
validatorMessage="Field Is mandatory" />
<p:spinner id="transPrice" required="true" size="5"
value="#{portfolioTransactionBean.txnCurrentRecord.umptPrice}"
label="Price"
validatorMessage="Field Is mandatory" />
<p:spinner id="brokerage" size="5"
value="#{portfolioTransactionBean.txnCurrentRecord.umptBrokerage}" />
<h:inputText
value="#{portfolioTransactionBean.txnCurrentRecord.umptNotes}" />
<f:facet name="footer">
<p:commandButton value="Save Transaction " icon="ui-icon-check"
action="#{portfolioTransactionBean.savePortfolioTransaction}"
update="panel" style="float:right;right:20%;">
<p:resetInput target="transactionPanel" />
</p:commandButton>
<p:spacer width="100" height="10" />
<p:commandButton value="Clear" update="transactionPanel"
process="@this">
<p:resetInput target="transactionPanel" />
</p:commandButton>
</f:facet>
</p:panelGrid>
表單驗證失敗後如用戶不輸入日期或公司名稱,我能夠看到正確的消息,但之後,我不能夠輸入任何值從keybord.Any一知道是什麼問題的代碼。
只有當驗證失敗時纔會出現此問題,即使當我單擊清除按鈕時,我也會遇到同樣的問題。任何人都會遇到這個問題?
你是指什麼意思?輸入組件是灰色還是啓用,但鍵盤輸入不反映在屏幕上?試着將'
'移出面板之外或面板之外 – kolossus我無法在文本框,微調器,鍵盤上輸入任何東西,即使我在面板外面放置了命令按鈕 –
有趣。嘗試在resetInput操作之前和之後比較面板周圍HTML標記的狀態。我也希望你沒有嵌套' '在那裏 –
kolossus