1
で働いていないバインディング私はビューで、私が使用するユーザー入力バインドさ属性String id
のAJAX呼び出しに基づいていくつかのデータを取得するには、正しくデータビーンは、AJAX呼び出し
<var name="contactForm" class="my.package.bean.ContactFormHelper"/>
を提出するヘルパーを定義する流れを持っていますこのように:
<h:panelGroup >
<p:outputLabel for="id" value="ID" />
<p:inputText id="id" required="true" value="#{contactForm.id}" label="ID">
<f:ajax
event="change"
listener="#{contactController.identifyCustomer(contactForm)}"
render="anotherPanel"
/>
<p:clientValidator/>
</p:inputText>
<p:message for="id" />
</h:panelGroup>
しかしidentifyCustomer
は、AJAXが置かれている唯一のフィールド(String id
)が更新されて実行されます。残りのフィールドはデフォルト値で埋められます。
LOGのTRACE
[21/11/16 17:10:12:508 CET] 0000007a SystemOut O DEBUG [Webコンテナ:0:8610ff45-f4c5-4faf-A370-efa36701bc01] - ContactForm [name =、surnames =、nif = 46713535Y]
なぜこのようなことが起こっているのでしょうか?
例には1つのフィールドしかありません... [mcve]お願いします(そして 'p:ajax'を試しましたか?) – Kukeltje
これを読んでくださいhttp://stackoverflow.com/questions/25339056/understanding-primefaces- process-update-and-jsf-fajax-execute-render-attributesがあなたの質問に答えると思います – Kukeltje