Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 如何添加一个";更新;属性设置为动态创建的commandButton_Jsf_Jsf 2_Primefaces - Fatal编程技术网

Jsf 如何添加一个";更新;属性设置为动态创建的commandButton

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

我尝试从一个bean动态创建一个
。它必须看起来像:

<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.