Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tridion 如何为自定义按钮触发PopupReference.js_Tridion_Tridion 2011 - Fatal编程技术网

Tridion 如何为自定义按钮触发PopupReference.js

Tridion 如何为自定义按钮触发PopupReference.js,tridion,tridion-2011,Tridion,Tridion 2011,我已经创建了一个功能齐全的按钮,名为“buttonreference”。我正在尝试创建一个具有相同功能和不同名称的不同按钮,如“TestButton”。我遵循这些步骤 已创建名为Testbutton的文件夹。 已为此文件夹创建虚拟目录。 已在系统配置中创建编辑器。 但当我试图访问此按钮时,它会触发buttonreference文件夹中的PopupReference.js,而不是触发我文件夹“Testbutton”中的PopupReference.js。我不知道为什么它没有触发我的js 我的Tes

我已经创建了一个功能齐全的按钮,名为“buttonreference”。我正在尝试创建一个具有相同功能和不同名称的不同按钮,如“TestButton”。我遵循这些步骤

  • 已创建名为Testbutton的文件夹。
  • 已为此文件夹创建虚拟目录。
  • 已在系统配置中创建编辑器。
  • 但当我试图访问此按钮时,它会触发buttonreference文件夹中的PopupReference.js,而不是触发我文件夹“Testbutton”中的PopupReference.js。我不知道为什么它没有触发我的js
  • 我的Testbutton.js如下:

    Type.registerNamespace(“RTFExtensions.Commands”);
    RTFExtensions.Commands.TestButton=函数命令$TestButton(名称){
    类型.enableInterface(这是“RTFExtensions.Commands.TestButton”);
    this.addInterface(“Tridion.Cme.Command”,[name | |“TestButton]”);
    这个.addInterface(“Tridion.Cme.FaCommand”,[name | |“TestButton]”);
    };
    RTFExtensions.Commands.TestButton.prototype.\u isAvailable=函数TestButton$\u isAvailable(目标){
    if(target.editor.getDisposed()){
    返回false;
    }
    返回true;
    };
    RTFExtensions.Commands.TestButton.prototype.\u isEnabled=函数TestButton$\u isEnabled(目标){
    if(!Tridion.OO.implementsInterface(target.editor,“Tridion.FormatArea”)| | target.editor.getDisposed()){
    返回false;
    }
    返回true;
    };
    RTFExtensions.Commands.TestButton.prototype.\u execute=函数TestButton$\u execute(目标){
    if(target.item.isActivePopupOpen()){
    回来
    }
    函数TestButton$execute$OnPopupCancelled(事件){
    target.item.closeActivePopup();
    };
    var url=$config.expandEditorPath(“/Popups/PopupReference.aspx”,“TestButton”);
    //警报(url);
    var popup=$popup.create(url,“工具栏=否,宽度=900,高度=800,可调整大小=是,滚动条=是”,null);
    $evt.addEventHandler(弹出“提交”,
    函数TestButton$execute$OnPopusSubmitted(事件){
    警报(“内部测试按钮”);
    //释放
    target.item.closeActivePopup();
    }
    );
    $evt.addEventHandler(弹出“卸载”,测试按钮$execute$OnPopupCancelled);
    target.item.setActivePopup(弹出窗口);
    popup.open();
    };
    
    我的TestButton配置文件如下所示:

    
    /弹出窗口/PopupReference.js
    Tridion.Web.UI.Editors.CME
    Tridion.Web.UI.Editors.CME.commands
    /Commands/TestButton.js
    RTFExtensions.TestButton.CommandSet
    Tridion.Web.UI.Editors.CME
    Tridion.Web.UI.Editors.CME.commands
    测试按钮
    测试按钮
    RTFExtensions.TestButton.Commands
    主题
    
    我的PopupReference.Js类似于:

    Type.registerNamespace(“RTFExtensions.Popups”);
    RTFExtensions.Popups.PopupReference=函数(元素){
    类型.enableInterface(这是“RTFExtensions.Popups.PopupReference”);
    这个.addInterface(“Tridion.Cme.View”);
    };
    RTFExtensions.Popups.PopupReference.prototype.initialize=函数(){
    $log.message(“初始化按钮引用弹出窗口…”);
    callBase(“Tridion.Cme.View”,“initialize”);
    $log.message(“初始化TestButton引用弹出窗口…”);
    var p=该属性;
    var c=p.对照组;
    p、 HtmlValue={value:null};
    c、 InsertButton=$controls.getControl($(“#InsertButton”),“Tridion.controls.Button”);
    $evt.addEventHandler(c.InsertButton,“click”,this.getDelegate(this.u execute));
    };
    RTFExtensions.Popups.PopupReference.prototype.\u execute=function(){
    警报(“内部Popupreferencejs”);
    this.firevent(“提交”,this.properties.HtmlValue);
    window.close();
    };
    $display.registerView(RTFExtensions.Popups.PopupReference);
    
    TestButton的CS页面如下所示:

    名称空间Tridion.GUI.Extensions.RTF.Popups
    {
    [ControlResourcesDependence(新类型[]{typeof(弹出)、typeof(Tridion.Web.UI.Controls.Button)、typeof(堆栈)、typeof(下拉)、typeof(列表)}]
    [ControlResources(“RTFExtensions.TestButton”)]
    公共部分类PopupReference:TridionPage
    {
    受保护的覆盖无效OnInit(事件参数e)
    {
    碱基.奥尼特(e);
    TridionManager tm=新的TridionManager();
    tm.Editor=“RTFTestButton”;
    System.Web.UI.HtmlControls.HtmlGenericControl dep=新的System.Web.UI.HtmlControls.HtmlGenericControl(“依赖项”);
    dep.InnerText=“Tridion.Web.UI.Editors.CME”;
    tm.dependencies.Add(dep);
    System.Web.UI.HtmlControls.HtmlGenericControl dep2=新建System.Web.UI.HtmlControls.HtmlGenericControl(“依赖项”);
    dep2.InnerText=“Tridion.Web.UI.Editors.CME.commands”;
    tm.dependencies.Add(dep2);
    //将它们添加到标题部分
    this.Header.Controls.Add(tm);//At(0,tm);
    }
    }
    }
    

    有人能帮我找到问题吗。创建新按钮时是否缺少任何步骤?我需要把.dll保存到任何地方吗?

    对我来说,一切看起来都很好

    在您的c#中,您使用以下代码调用参考组:

    [ControlResources("RTFExtensions.TestButton")]
    
    我还看到您的配置文件包含组“RTFExtensions.TestButton”,因此一切看起来都正常

    您是否构建了.net项目并将DLL放入[tridion_home]/web/webUI/webRoot/bin


    ??

    对我来说,一切看起来都很好

    在您的c#中,您使用以下代码调用参考组:

    [ControlResources("RTFExtensions.TestButton")]
    
    我还看到您的配置文件包含组“RTFExtensions.TestButton”,因此一切看起来都正常

    您是否构建了.net项目并将DLL放入[tridion_home]/web/webUI/webRoot/bin


    ??

    您必须在弹出的aspx p中为更新的代码编译dll