简体   繁体   English

RichFaces组件rich:input似乎不适用于JQuery

[英]RichFaces component rich:input does not seem to work with JQuery

Continuing using JQuery with RichFaces components, I've noticed that when you import one of the JQuery scripts, particularly this one: "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js", one of RichFaces components, "rich:inplaceInput", doesn't seem to work. 继续将JQuery与RichFaces组件一起使用时,我注意到当您导入一个JQuery脚本,尤其是以下一个脚本时:“ http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min。 js”,RichFaces组件之一,“ rich:inplaceInput”,似乎无效。 The input appears, but the javascript it uses disappears, so no matter how many times you click it, nothing happens. 输入出现,但是使用的javascript消失了,因此,无论您单击多少次,都不会发生任何事情。 Here is my header: 这是我的标题:

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

And in the body I create a simple and there I have a simple panel and a simple inplace input: 然后在主体中创建一个简单的面板,并在其中创建一个简单的面板和一个简单的就地输入:

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

That's all, and it works only when I remove the first script import, the one that includes "jquery.min" javascript file. 就是这样,并且仅当我删除第一个脚本导入(包括“ jquery.min” javascript文件)的脚本时,它才起作用。

Any idea why this happens? 知道为什么会这样吗? Is it a bug in RichFaces? 这是RichFaces中的错误吗? Is there a workaround or is it only possible after upgrading RichFaces? 是否有解决方法,还是只有在升级RichFaces之后才可能? (I'm using 3.3.3 version) (我正在使用3.3.3版本)

Thanks for all your help. 感谢你的帮助。

I'm not familiar with Richfaces , but it seems that it come with jquery out of the box 我不熟悉Richfaces,但似乎jquery附带了它

and can be used like this (reference to the version built-it jQuery) 并且可以像这样使用(参考内置的jQuery版本)

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

When you try to import another jQuery.js file it results in conflicts... 当您尝试导入另一个jQuery.js文件时,会导致冲突...

Look here Avoid jquery conflict in my jsf application 在这里查看避免在我的jsf应用程序中出现jquery冲突

and Here Richfaces with jQuery 和这里Richfaces与jQuery

to learn more... 了解更多...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM