首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决Tridion弹出页面中的"Tridion is undefined“错误?

如何解决Tridion弹出页面中的"Tridion is undefined“错误?
EN

Stack Overflow用户
提问于 2012-04-05 20:21:06
回答 3查看 705关注 0票数 4

我正在自定义ribbon工具栏并向其添加一个按钮。每当我单击该按钮时,它都会打开一个允许作者选择某些数据的aspx页面,这些数据将被附加到现有的RTF字段内容中。

但当弹出窗口打开时,它在浏览器(Internet Explorer)中显示以下错误。

代码语言:javascript
复制
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0;     SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Thu, 5 Apr 2012 12:18:35 UTC


Message: 'Tridion' is undefined
Line: 1
Char: 1
Code: 0
URI: http://172.21.188.26:2694/WebUI/Core/stringresources.js

在指定位置找不到stringresources.js文件。请给我一个解决这个问题的方法。

Type.registerNamespace("RTFExtensions.Commands");文件: ButtonReference.js文件

代码语言:javascript
复制
RTFExtensions.Commands.ButtonReference = function Commands$ButtonReference(name) { 
    Type.enableInterface(this, "RTFExtensions.Commands.ButtonReference"); 
    this.addInterface("Tridion.Cme.Command", [name || "ButtonReference"]); 
    this.addInterface("Tridion.Cme.FaCommand", [name || "ButtonReference"]); 
}; 

RTFExtensions.Commands.ButtonReference.prototype._isAvailable = function         ButtonReference$_isAvailable(target) { 
    if (target.editor.getDisposed()) { 
        return false; 
    } 

    return true; 
}; 

RTFExtensions.Commands.ButtonReference.prototype._isEnabled = function ButtonReference$_isEnabled(target) { 
    if (!Tridion.OO.implementsInterface(target.editor, "Tridion.FormatArea") ||             target.editor.getDisposed()) { 
        return false; 
    } 

    return true; 
};

RTFExtensions.Commands.ButtonReference.prototype._execute = function     ButtonReference$_execute(target) {
    if (target.item.isActivePopupOpened()) {
        return;
    }

    function ButtonReference$execute$onPopupCanceled(event) {
        target.item.closeActivePopup();
    };

    //var url = $config.expandEditorPath("/Popups/PopupReference.aspx", "RTFExtensions"); 
    var schemaId = $display.getView().getItem().getSchemaId();
    var componentName = $display.getView().getItem().getTitle();
    //alert($display.getView().getItem().getId());
    alert($display.getView().getItem().getTitle());
    var url = "Editors/RTFExtensions/Popups/PopupReference.aspx?schemaId=" + schemaId + "&componentName=" + componentName;
    //var url = "Editors/RTFExtensions/Popups/PopupReference.aspx";
    alert("url is " + url);
    var dialogFeatures = $cme.Popups.ITEM_SELECT.FEATURES;
    var popup = $popup.create(url, dialogFeatures, null);

    $evt.addEventHandler(popup, "submit",
        function ButtonReference$execute$onPopupSubmitted(event) {
            // Update FA 
            var value = event.data.value;
            if (value) {
                alert("In Button Reference value:" + value);
                target.editor.applyHTML(value);
            }

            // Release 
            target.item.closeActivePopup();
        }
    );

    $evt.addEventHandler(popup, "unload", ButtonReference$execute$onPopupCanceled);

    target.item.setActivePopup(popup);
    popup.open();
}; 

PopupReference.js文件:

代码语言:javascript
复制
Type.registerNamespace("RTFExtensions.Popups");

RTFExtensions.Popups.PopupReference = function (element) {
    Type.enableInterface(this, "RTFExtensions.Popups.PopupReference");
    this.addInterface("Tridion.Cme.View");
};

RTFExtensions.Popups.PopupReference.prototype.initialize = function () {
    alert("initialized");    
    $log.message("Initializing Button Reference popup...");
    this.callBase("Tridion.Cme.View", "initialize");

    var p = this.properties;
    var c = p.controls;

    p.HtmlValue = { value: null };
    c.SubmitButon = $("#Submit");   
    //asp dropdown
    //c.DropDown = $("#lookupvaluesDropdown");
    //alert($("#lookupvaluesDropdown").value + "in initialize");        
    $evt.addEventHandler(c.SubmitButon, "click", this.getDelegate(this._execute));

    //    $evt.addEventHandler(c.InsertButton, "OnSelectedIndexChanged", this.getDelegate(this._execute));
};

RTFExtensions.Popups.PopupReference.prototype._execute = function () {
    alert("executing");
    //alert($("#lookupvaluesDropdown").value);
    this.properties.HtmlValue.value = $("#lookupvaluesDropdown").value;
    alert(this.properties.HtmlValue.value + " in execute");
    this.fireEvent("submit", this.properties.HtmlValue);

    alert("after fire event");
    //$("#Submit").fireEvent("submit1", this.properties.HtmlValue);
    window.close();
};



$display.registerView(RTFExtensions.Popups.PopupReference); 

PopupReference.aspx页面:

代码语言:javascript
复制
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PopupReference.aspx.cs"
    Inherits="ButtonReference.Popups.PopupReference" %>

<%@ Import Namespace="Tridion.Web.UI.Core" %>
<%@ Import Namespace="Tridion.Web.UI" %>
<%@ Import Namespace="System.Web" %> 
<%@ Register TagPrefix="ui"  Namespace="Tridion.Web.UI.Editors.CME.Controls" Assembly="Tridion.Web.UI.Editors.CME"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://www.sdltridion.com/web/ui/core/controls">
<head id="Head1" runat="server">
    <title>Reference Button Popup</title>
    <cc:tridionmanager runat="server" editor="PowerTools2011">
        <dependencies runat="server">
            <dependency runat="server">Powertools2011.Example</dependency>
            <dependency runat="server">Tridion.Web.UI.Editors.CME</dependency>
            <dependency runat="server">Tridion.Web.UI.Editors.CME.commands</dependency>
        </dependencies>
    </cc:tridionmanager>

</head>
<body>
    <form id="form1" runat="server">
    <div>        
        <h1>
            Reference Button Popup
        </h1>
        <table>        
        <tr><td><asp:DropDownList ID="lookupvaluesDropdown" runat="server"></asp:DropDownList></td></tr>
        <tr><td><asp:Button ID="Submit" runat="server" Text="Submit" /></td></tr>

        </table>
    </div>
    </form>
</body>
</html>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2012-04-05 20:28:53

这意味着没有加载Tridion中的JavaScript。您是否包含了

代码语言:javascript
复制
<cc:tridionmanager runat="server" editor="PowerTools"> 

弹出页面上的UserControl?

票数 5
EN

Stack Overflow用户

发布于 2012-04-06 01:03:53

我可能在重复我的话,但是您是否尝试过遵循任何可用教程来创建GUI扩展?

你能让它们中的任何一个工作吗?

提示:谷歌搜索"Tridion gui扩展教程“

票数 3
EN

Stack Overflow用户

发布于 2012-07-01 18:03:47

我最近收到了同样的错误,尽管可能是由于不同的原因。

  1. Robert Curlette (RCWeb)有一个关于这两个now-familiar "broken" GUI screens的很好的指南。
  2. 我们也从PowerTools wiki得到了一个很好的提示,特别是来自

Kjaer:

直接访问资源http://{hostname}/WebUI/Editors/CME/Views/Dashboard/Dashboard_v6.{version number}_.aspx?mode=js

我可以在Chrome的控制台中看到这一点,但缺少一个服务dll。我收到了相同的Tridion is not defined错误,但仪表板出现了另一个错误。您可以右键单击Dashboard_...链接,打开一个新选项卡,并获取更多信息。

代码语言:javascript
复制
Uncaught SyntaxError: Unexpected token < Dashboard_v6.1.0.55920.2_.aspx?mode=js:3
Uncaught ReferenceError: Tridion is not defined stringresources.js:1
(anonymous function) stringresources.js:1

在我的具体案例中,我有以下几点。

代码语言:javascript
复制
Exception of type 'System.Web.HttpUnhandledException' was thrown.
Could not find file 'C:\Program Files (x86)\Tridion\PowerTools\Model\Services\{one of the many outstanding contributions}.svc'.

删除Model配置文件中的问题文件修复了我的错误。尽管我们可能永远不会知道在查询字符串中这两个项的神秘情况下到底发生了什么。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10028501

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档