我对 ajax 很陌生,并试图将一个框的值复制到另一个框。这是我的代码:
<h:form>
<h:inputText value="#{ajaxBean.name}">
<f:ajax render="otherbox" execute="@this" event="keyup"></f:ajax>
</h:inputText>
<h:inputText id="otherbox" value="#{ajaxBean.name}"></h:inputText>
</h:form>
还有豆
@Named(value = "ajaxBean")
@Dependent
public class AjaxBean {
public AjaxBean() {
}
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
该代码不起作用。谁能帮我?
谢谢