【问题标题】:onChange not Firing with RichfacesonChange 不使用 Richfaces 触发
【发布时间】:2014-11-10 14:59:16
【问题描述】:

以下代码有什么问题? 我正在尝试触发 onchange 事件,但它没有触发。 有什么技巧吗?

<h:inputText id="productIdField" required="false" styleClass="txt" >
    <f:validateLength minimum="2" />
    <rich:toolTip showDelay="500"  styleClass="bgcolor-white">
    </rich:toolTip>
    <a:support event="onchange" ajaxSingle="true"  requestDelay="250" action="testChange();"/>
    </h:inputText>

Javascript:

function testChange(){

                alert('TestChange');

                }

【问题讨论】:

    标签: jsf richfaces seam


    【解决方案1】:

    action 属性用于引用某个 bean 中的方法,该方法应在触发 event 时调用,而不是 JavaScript 函数。来自documentation

    类型:javax.el.MethodExpression (签名必须匹配 java.lang.Object action()) - MethodBinding 指向要调用的应用程序操作...

    例子:

    <h:inputText value="#{bean.text}">
          <a4j:support event="onkeyup" reRender="output" action="#{bean.action}"/>
    </h:inputText>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-12
      • 2011-12-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多