我有一个p:commandButton
点击,我需要在列表中添加一些值。在我的托管 bean 中,我正在验证必须添加的值,如果它验证为 false,我必须显示一个确认弹出窗口。这是我的代码 -
<p:commandButton id="add" value="Add" type="submit" action="#{bean.doAdd}" ajax="false"
update=":List"/>
在 bean 中,单击“添加”按钮,
public String doAdd() throws Exception {
if(response != null) {
if(keyList.contains(response)) {
if(!responseList.contains(response)) {
responseList.add(response);
}
} else {
//Have to display confirmation popup.
}
response = "";
}
return response;
}
我正在使用 jsf 2.0 和 primefaces 3.0。有人可以告诉我如何显示 bean 的弹出窗口吗?