【问题标题】:ExtJs with GateIn not working带有 GateIn 的 ExtJs 不工作
【发布时间】:2013-10-17 12:01:53
【问题描述】:

我通过以下方式在gatein-resources.xml(我使用GateIn 3.6)上添加了ExtJS(我正在使用ExtJs 3.2)库

<module> <name>ext-base</name> <script> <path>/javascript/lib/ext-2.1/adapter/ext/ext-base.js</path> </script> </module> <module> <name>ext-all</name> <script><path>/javascript/lib/ext-2.1/ext-all.js</path></script> <depends> <module>ext-base</module> </depends> </module> <module> <name>extCommons</name> <script><path>/javascript/commons/extCommons.js</path></script> <depends> <module>ext-base</module> </depends> </module> ..... <portal> <name>MyPortal</name> <module> <depends> <module>ext-base</module> </depends> <depends> <module>extCommons</module> </depends> <depends> <module>ext-all</module> </depends> </portal>

但是当我启动 GateIn 时,我的 firebug 控制台上出现 Ext not defined 错误

另外here我附上了由gatein-resources.xml文件处理的ext-base.js文件(Here是原来的ext-base.js)

但它在 GateIn 3.2 上运行良好。在那个版本上,我使用 标签来添加 javascript gatein-resources.xml 文件。但是在 GateIn 3.6 中不推荐使用此标签,因此我在 gatein-resources.xml 上使用上述指定标签

如何重现此问题:- Here 是 ext-base.js 文件,它在启动 GateIn 时带有 gateIn 的标头标记,并且这个 ext-base.js 文件是通过 gatein-resources 添加的.xml。 Here 是原始的 ext-base.js。这两个文件的区别在于 ext-base.js 来自 gatein,其中包含一些额外的代码行

define('SHARED/ext-base', [], function() { var require = eXo.require, requirejs = eXo.require,define = eXo.define; eXo.define.names=[]; eXo.define.deps=[]; return //Continued by original ext-base code });

但是,如果您在 firebug 控制台上运行此代码并执行“Ext”命令,则 firebug 会返回一个错误,即 “Ext 未定义”。 但是,如果您运行原始代码,则可以成功执行“Ext”命令。 我重复一遍'我正在使用 GateIn 作为开发模式'

【问题讨论】:

    标签: javascript extjs gatein


    【解决方案1】:

    您可以使用&lt;script&gt; 标签直接导入&lt;portal&gt;...&lt;/portal&gt; 标签之间的javascript。为此,您需要像以下一样安排gatein-resource.xml

    <portal> <name>MyPortal</name> <scripts> <script><path>/javascript/lib/DwrProxy.js</path></script> <script><path>/javascript/commons/validation.js</path></script> <script><path>/javascript/lib/ext-2.1/ext-all-debug.js</path></script> ... </scripts> </portal>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-23
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-22
      相关资源
      最近更新 更多