JSF バインディング コンポーネントに問題があります。
私の xhtml ページには、バインディング属性を持つパネル グループがあります。
<h:panelGroup binding="#{formularioBean.panelGroup}" layout="block" id="campoDinamico" />
ベーキングビーンのコードは
public HtmlPanelGroup getPanelGroup() {
HtmlPanelGroup panelGroup = new HtmlPanelGroup();
Field field = new Field();
HtmlOutputText textoLabel = new HtmlOutputText();
textoLabel.setValue(JSFUtils.getStringFromBundle("formulario.label.TEXTO_1"));
textoLabel.setStyle("font-weight: bold; font-size: 12px");
field.getChildren().add(textoLabel);
int count = 0;
for (String textoParcial : this.listaTextoSugerencia) {
InputText input = new InputText();
input.setId("id_tx" + count);
input.setValue(textoParcial);
input.setImmediate(true);
count++;
field.getChildren().add(input);
}
panelGroup.getChildren().add(field);
}
以下の同じフォームには、primefaces コマンド ボタンがあります。
<p:commandButton value="Añadir" actionListener="#{formularioBean.addInputText}" update="campoDinamico"/>
私の問題は、このボタンをクリックすると、actionListener が呼び出される前に、bingind コンポーネントがバッキング Bean バインディング メソッドを呼び出すことです。
これを防ぎ、actionListener の終了後に更新するにはどうすればよいですか?
私はprimefaces 3.5、primefaces mobile 0.9.4、JSF 2を使用しており、Beanはビュースコープです
ありがとう