问题从Richfaces 3.1.6迁移到4.3.4

时间:2013-10-22 17:17:31

标签: richfaces

我正在从jsf 1.1(使用richfaces 3.1.6)迁移到2.0(使用richfaces 4.3.4)。我遇到了富表面4.3.4的一些问题,并且无法弄清楚。我写了下面的test.xhtml来更好地描述我遇到的问题:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
    <title>My Account - View Device(s)</title>
    <script type="text/javascript" src="redesign/scripts/jquery.js?v=1.7.2"></script>
    <script type="text/javascript" src="redesign/scripts/jquery.filter_input.js"></script>

    <script type="text/javascript">
        //<![CDATA[
        $(document).ready(function(){
            $('#testForm:\\numField').filter_input({regex:'[0-9]'});
        });
        //]]>

    </script>
    </h:head>

    <h:body>
        <h:form id="testForm">
            <h:outputText value="User ID: " /><h:inputText id="numField" value="#{testBean.userID}"/>
            <h:commandLink action="#{testBean.updateUserID}" value="myfaces CommandButton"/>
            <h:outputText value=" | " />
            <a4j:commandLink reRender="testForm" value="A4J Command Link" action="#{testBean.updateUserID }" /> 
        </h:form>
    </h:body>
</html>

以下是我在这个test.xhtml中看到的问题:

1)当test.xhtml页面中出现“a4j:commandLink”标签时,所有jquery插件都无法加载(获取$(“#testForm \:numField”)。在这种情况下,filter_input不是函数错误) 。如果我从这个test.xhtml页面中删除了“a4j:commandLink”标签,那么所有插件都可以正常工作。

2)单击“a4j:commandLink”时出现此错误:javax.el.PropertyNotFoundException:在com.arch.myaccount.jsf.TestBean类型上找不到属性“updateUserID”。 “h:commandLink”绑定到同一个动作,效果很好。

我将不胜感激。

1 个答案:

答案 0 :(得分:1)

<a4j:commandLink reRender="testForm" value="A4J Command Link" action="#{testBean.updateUserID }" />

reRender已从RichFaces 3更改为render - &gt; RichFaces 4.改变它,那么它将被“重新渲染”就好了。