【问题标题】:a4j:support and seam: Illegal Syntax for Set Operationa4j:support and seam:集合操作的非法语法
【发布时间】:2011-06-04 02:42:50
【问题描述】:

我通常使用 javascript 来解决这个问题,但我正在尝试在 seam 项目 + jsf + faces 上使用 de a4j。我只想使用 ajax4jsf 为日期创建一个简单的掩码输入,但我总是遇到同样的错误:设置操作的非法语法。我正在关注此页面示例:http://www.javabeat.net/articles/19-introduction-to-ajax4jsf-3.html

页面代码:

<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>

支持 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);
}

setter 和 getter 方法是正常的,但是当我访问该页面时,我收到此错误:

javax.el.PropertyNotWritableException: /T233Ev01CreateRevendas.xhtml @284,140 binding="t233SeamBean.userInput": 非法集操作语法

谁能给我一个线索?

提前致谢

【问题讨论】:

    标签: java jsf richfaces seam ajax4jsf


    【解决方案1】:

    这看起来不对:

    binding="t233SeamBean.userInput"
    

    您不能将输入组件绑定到 Ajax 支持组件。

    【讨论】:

      猜你喜欢
      • 2013-08-20
      • 2013-01-10
      • 1970-01-01
      • 1970-01-01
      • 2017-07-02
      • 2012-03-18
      • 2017-02-21
      • 2014-08-13
      相关资源
      最近更新 更多