我想将一个值传递给一个对话框,但它不起作用。我已经尝试过这种方法但没有运气
这是我的页面:
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title></title>
</h:head>
<h:body>
<h:form>
<p:inputText value="#{myManagedBean.input}"/>
<p:commandButton value="edit" onclick="dlg.show()"/>
<p:dialog widgetVar="dlg" modal="true">
passed value:<p:inputText value="#{myManagedBean.input}"/>
</p:dialog>
</h:form>
</h:body>
</html>
和我的托管豆
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class MyManagedBean implements Serializable {
private String input;
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
}
}
我错过了什么吗?