I'm usually resolve this problem using javascript, but i'm trying to use de a4j on a seam project + jsf + faces. I just want to create a simple mask input for date using ajax4jsf but i always have the same error: Illegal Syntax for Set Operation. I was following this page example: http://www.javabeat.net/articles/19-introduction-t开发者_运维技巧o-ajax4jsf-3.html.
The page code:
<s:decorate template="layout/display.xhtml" id="dataEmissaoD">
<ui:define name="label">Data Emissão CRV</ui:define>
<h:inputText id="dataEmissao" value="#{t233SeamBean.t233Ev01.dataEmissaoDT}" required="true" maxlength="10">
<f:convertDateTime timeZone="#{t233SeamBean.t233Ev01.timeZone}" pattern="dd/MM/yyyy" />
<a4j:support event="onkeypress" reRender="dataEmissao" action="#{t233SeamBean.formatar}" binding="t233SeamBean.userInput"></a4j:support>
<a4j:support event="onblur" ajaxSingle="true" reRender="dataEmissaoD"/>
</h:inputText>
<h:outputText value="(ex: 01/01/2010)" />
<ui:define name="message"><h:message for="dataEmissao" styleClass="error" /></ui:define>
</s:decorate>
Backing bean:
private UIInput userInput;
public UIInput getUserInput() {
return userInput;
}
public void setUserInput(UIInput userInput) {
this.userInput = userInput;
}
public void formatar(){
UIInput input = new UIInput();
input.setValue("TESTE");
setUserInput(input);
}
The setter and getter methods are normal but when i access the page i receive this error:
javax.el.PropertyNotWritableException: /T233Ev01CreateRevendas.xhtml @284,140 binding="t233SeamBean.userInput": Illegal Syntax for Set Operation
someone can give me a clue?
thanks in advance
This doesn't look right:
binding="t233SeamBean.userInput"
You can't bind an input component to an Ajax support component.
精彩评论