1

我正在实现功能区工具栏按钮。根据架构名称单击按钮时,我需要使用相应的 url(Aspx 页面)创建弹出窗口。以前我只使用一个 aspx 页面并且我成功了,我创建了一个与 aspx 页面同名的弹出 java 脚本文件并在配置文件中配置它。但是在多个 aspx 页面的情况下,即使我创建了多个弹出 javascript 文件。它不会调用受尊重的 javascript 文件。

如果有多个 aspx 页面,如何将弹出的 java 脚本文件映射到 aspx 页面?

PFB 代码示例。

Button java script file code fragment:

if (some condition) {
         //Creating the url    
         var url = "Editors/RTFExtension/Popups/ButtonReferencePopup_2.aspx?schemaId='" + schemaId + "'";
         var popup = $popup.create(url, "toolbar=no,width=500,height=200,resizable=yes,scrollbars=yes", null);
}
else{
        //Creating the url    
        var url = "Editors/RTFExtension/Popups/ButtonReferencePopup.aspx?schemaId='" + schemaId + "'";
        var popup = $popup.create(url, "toolbar=no,width=500,height=200,resizable=yes,scrollbars=yes", null);
}

Config file code fragment:

<cfg:group name="RTFExtension.ButtonReference">
        <cfg:fileset>          
          <cfg:file type="script">/Popups/ButtonReferencePopup.js</cfg:file>
          <cfg:file type="script">/Popups/ButtonReferencePopup_2.js</cfg:file>
          <cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
        </cfg:fileset>       

        <cfg:dependencies>
          <cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
          <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
          <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
        </cfg:dependencies>
</cfg:group>

请帮我解决这个问题。提前致谢。早期反应表示赞赏。

4

1 回答 1

2

我相信您需要为每个配置配置不同的组 - 如下所示:

<cfg:group name="RTFExtension.ButtonReference.Popup1">
    <cfg:fileset>          
      <cfg:file type="script">/Popups/ButtonReferencePopup.js</cfg:file>
      <cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
    </cfg:fileset>       

    <cfg:dependencies>
      <cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
    </cfg:dependencies>
</cfg:group>

<cfg:group name="RTFExtension.ButtonReference.Popup2">
    <cfg:fileset>          
      <cfg:file type="script">/Popups/ButtonReferencePopup_2.js</cfg:file>
      <cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
    </cfg:fileset>       

    <cfg:dependencies>
      <cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
      <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
    </cfg:dependencies>
</cfg:group>

在您的弹出代码隐藏中,您需要引用相关组:

namespace Button.Reference.Popups
{
    [ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
    [ControlResources("RTFExtensions.ButtonReference.Popup1")]
    public partial class PopupReference1 : TridionPage

或者:

namespace Button.Reference.Popups
{
    [ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
    [ControlResources("RTFExtensions.ButtonReference.Popup2")]
    public partial class PopupReference2 : TridionPage
于 2012-07-03T10:08:50.967 回答