Jsf 如何添加一个";更新;属性设置为动态创建的commandButton
我尝试从一个bean动态创建一个Jsf 如何添加一个";更新;属性设置为动态创建的commandButton,jsf,jsf-2,primefaces,Jsf,Jsf 2,Primefaces,我尝试从一个bean动态创建一个。它必须看起来像: <h:commandButton actionListener="#{bean.okUpdate("1234")}" title="ok" value="ok" id="ok_1234" update:"otherComponent"/> ->我应该添加哪些代码,以便commandButton也包括更新:“otherComponent”?使用Primefaces commandButton类 它有一个“update”值expres
。它必须看起来像:
<h:commandButton actionListener="#{bean.okUpdate("1234")}" title="ok" value="ok" id="ok_1234" update:"otherComponent"/>
->我应该添加哪些代码,以便commandButton也包括更新:“otherComponent”?使用Primefaces commandButton类 它有一个“
update
”值expression
此标记不存在属性“update”。
HtmlCommandButton okUpdate = new HtmlCommandButton();
okUpdate.setLabel("ok");
okUpdate.setValue("ok");
okUpdate.setId("okUpdate_" + uuid);
okUpdate.setActionExpression(createMethodExpression(String.format("#{bean.okUpdate('" + uuid + "')}", "ok"), null, String.class));
org.primefaces.component.CommandButton.