【问题标题】:RichFaces component rich:input does not seem to work with JQueryRichFaces 组件丰富:输入似乎不适用于 JQuery
【发布时间】:2012-05-22 07:00:01
【问题描述】:

继续使用带有 RichFaces 组件的 JQuery,我注意到当您导入其中一个 JQuery 脚本时,尤其是这个:“http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery .min.js”,RichFaces 组件之一,“rich:inplaceInput”,似乎不起作用。输入出现了,但它使用的 javascript 消失了,所以无论你点击多少次,都没有任何反应。这是我的标题:

    <f:view>
       <html>
         <head>
              <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
              <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
              <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
              <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>            
              <link rel="stylesheet" type="text/css" href="../../css/custom-styles.css" />
              <script type="text/javascript" src="../../js/customJS.js"></script>
              <a4j:loadScript src="resource:///jquery.js"/>
         </head>
       </html>
    </f:view>

在正文中,我创建了一个简单的,那里有一个简单的面板和一个简单的就地输入:

      <rich:panel id="simplePanel" style="width:560px;height:100px;">
          <rich:inplaceInput id="sample" defaultLabel="Some text" />
      </rich:panel>

仅此而已,它仅在我删除第一个脚本导入时有效,即包含“jquery.min”javascript 文件的那个。

知道为什么会这样吗?它是 RichFaces 中的错误吗?是否有解决方法,或者只有在升级 RichFaces 之后才有可能? (我用的是3.3.3版本)

感谢您的所有帮助。

【问题讨论】:

    标签: jquery jsf richfaces


    【解决方案1】:

    我对 Richfaces 不熟悉,但它似乎是 jquery 开箱即用的

    并且可以这样使用(参考jQuery自带的版本)

    <a4j:loadScript
    src="resource:///org/richfaces/renderkit/html/scripts/jquery/jquery.js" />
    

    当您尝试导入另一个 jQuery.js 文件时,会导致冲突...

    看这里Avoid jquery conflict in my jsf application

    这里是Richfaces with jQuery

    了解更多...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 2011-02-11
      • 2011-10-14
      • 2014-07-20
      相关资源
      最近更新 更多