このトピックについて多くのことが起こっていることは知っていますが、すべての解決策はリセットボタンの作成を指摘しています...フィールドをクリアして再入力する方法はありませんか?
これが私のコードです
<p:commandButton id="basic" value="#{c.machine}" action="#{updateEntry.setMachine(c.machine)}" oncomplete="dlg1.show();" styleClass="ui-Machinebutton"/>
これにより、'updateEntry' に値 'machine' が設定され、完了すると、ダイアログ ボックス 'dlg1' が起動します。
ダイアログボックス
<p:dialog id="Update_Entry" header="Update Entry" widgetVar="dlg1" modal="true" height="250" dynamic="True" resizable="False">
<h:form prependId="false" id="Update_Entry_Form" method="post" autocomplete="off">
<h:panelGrid id="update_grid" columns="2" style="margin-bottom:10px">
<f:facet name="header">
<p:messages />
</f:facet>
<h:outputLabel for="machine" value="Machine *" />
<p:inputText id="machine" value="#{updateEntry.machine}" required="true" requiredMessage="Machine is required">
<f:validateLength minimum="5" maximum="5"/>
</p:inputText>
フォームは最初は問題なく値をロードしますが、updateEntry.machine が更新されても常に前の値をロードします。これを自動的にオフにするにはどうすればよいですか? 私はPrimeFacesを使用しています