Help: JSF and a4j
843844Jun 20 2008 — edited Jun 23 2008Hi,
I am pretty new on JSF and Ajax and wonder if someone could help me to resolve this problem:
- I have 2 text boxes (Email Address and CC Address) and one check box (CC). When the checkbox is checked, it should copy the value from text box 1 to text box 2. Just simple like that. Here is how I did it:
<rich:inplaceInput value="#{emailBean.toAddresses}" id="toAddress" inputWidth="350" minInputWidth="350" required="true"/>
<rich:inplaceInput value="#{emailBean.ccAddresses}" id="ccAddress" inputWidth="350" minInputWidth="350"/>
<h:selectBooleanCheckbox id="ccMeCheckbox" valueChangeListener="#{emailReportBean.ccMe}">
<a4j:support event="onclick" reRender="ccAddress"/>
</h:selectBooleanCheckbox>
In the backingBean, here is what I did:
public void setCcAddresses(String ccAddresses) {
if (ccMe == Boolean.TRUE){
this.ccAddresses = this.fromAddress;
} else {
this.ccAddresses = ccAddresses;
}
}
But it is not working :(. Could someone help and tell me if I am missing anything. Thank you!