2012-04-05 5 views
4

リボンツールバーをカスタマイズしてボタンを追加しています。そのボタンをクリックするたびに、aspxページが開き、作成者は既存のRTFフィールドコンテンツに追加されるいくつかのデータを選択できます。Tridionのポップアップページで「Tridion is undefined」エラーを解決するにはどうすればよいですか?

しかし、ポップアップを開くとブラウザ(Internet Explorer)に以下のエラーが表示されます。

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ファイルが見つかりません。問題を解決する方法を教えてください。

ButtonReference.jsファイル: Type.registerNamespace( "RTFExtensions.Commands");

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ファイル:

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ページ:

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

答えて

5

これはTridionのからJavaScriptがロードされていないことを意味します。

<cc:tridionmanager runat="server" editor="PowerTools"> 

UserControlをポップアップページに追加しましたか?

+0

ありがとうございます。このタグは含まれていません。これを含める場所を教えてください。前もって感謝します。 –

+0

これをあなたのpopup.aspxページに含めてください。 (もっと)例が必要な場合は、code.google.comのPowerToolsプロジェクトをチェックアウトしてください。検索対象:プロジェクト全体のTridionManagerこれは、あなたが開始するのに十分な情報を与えるはずです。 –

+0

タグを追加しようとすると、不明なタグ接頭辞やフィルターのようなエラーが表示されます。接頭辞として 'c'を付ける必要がありますか? –

3

自分自身を繰り返しているかもしれませんが、GUIエクステンションを作成するためのチュートリアルを試してみましたか?

いずれかの機能を利用できますか?

ヒント:さまざまな理由からそうなのに「TridionのGUI拡張チュートリアル」

3

のためのgoogle私は最近、同じエラーを得ました。

  1. Robert Curlette(RCWeb)は、now-familiar "broken" GUI screensの素晴らしいガイドを持っています。
  2. 我々はまた、特にピーターKjaerのから、PowerTools wikiから良いヒントがあります:

ログインリソースに直接 ます。http:// {ホスト名}/WebUIの/編集/ CME /ビュー/ダッシュボード/ Dashboard_v6 。{バージョン 番号} _。aspx?mode = js

これはChromeのコンソールでサービスDLLが見つからないことがわかります。同じTridion is not definedエラーが発生しますが、もう1つはダッシュボードです。ダッシュボード_...リンクを右クリックして新しいタブを開き、詳細情報を入手できます。

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 

具体的には、次のとおりです。

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

モデル構成ファイルで問題のファイルを削除すると、エラーが修正されました。クエリーストリングの2つのアイテムの神秘的なケースで本当に何が起こったのかはわからないかもしれませんが。