This is a migrated thread and some comments may be shown as answers.

GetLocalizationScript error

8 Answers 28 Views
This is a migrated thread and some comments may be shown as answers.
Sub
Top achievements
Rank 1
Sub asked on 31 Jan 2012, 10:11 PM

Hi,

I am upgrading 2008 Q3 version of telerik control to 2011 Q3 version in my project in .NET 4.0. To localize/customize the HyperLinkManager of the editor, The LinkManager.ascx file (without .cs file) of the Telerik was customized.

We do have that file under RadControls\Editor\Dialogs folder. It used to work fine until we upgraded. Now, when we click the hyperlink manager icon on the editor it throws the below exception. Is there any workaround for this?

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.Dialogs.UserControlResources.GetLocalizationScript() +995
   Telerik.Web.UI.Dialogs.UserControlResources.OnPreRender(EventArgs e) +46
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint

8 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Feb 2012, 04:33 PM
Hi,

It is a requirement to use external files taken from the same installation as the Telerik.Web.UI.dll assembly.

The LinkManager of RadEditor is modified and enhanced multiple times from 2008 till now and your version of the LinkManager.ascx file is not compatible with the latest version of RadEditor. You should get the LinkManager.ascx file from the EditorDialogs folder from the 2011 Q3 installation and customize it from scratch. This is the only way to fix the error.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Sub
Top achievements
Rank 1
answered on 01 Feb 2012, 11:21 PM
Thanks for the response!

Is there any easy way to hide some of the controls in the HyperLink Manager and also localize all the texts in the HyperLink Manager with out having a copy of the LinkMnager.ascx file with our modificaiton. That way we dont have to customize the ascx file from the scratch everytime we upgrade.

Thanks in Advance!
0
Sub
Top achievements
Rank 1
answered on 02 Feb 2012, 09:58 PM
I have copied the ascx file from the 2011 version instalaation and customize it. I still could not set my own localization string for the tab texts and tooltips.

1. I used to have the below javascript to set the localized string

window.onload = function() {
        //BUG FIX
        //this method will localize the tabs on the hyperlink manager
        //this came from the old linkmanager but since the codebehind sets these values,
        //we can't simply set them in markup           
        var tabStrip = document.getElementById("LinkManagerTab");
  
        var hyperlinkText = document.getElementById("hiddenHyperlinkText").value;
        var anchorText = document.getElementById("hiddenAnchorText").value;
        var emailText = document.getElementById("hiddenEmailText").value;
  
        tabStrip.innerHTML = tabStrip.innerHTML.replace(">Hyperlink", ">" + hyperlinkText);
        tabStrip.innerHTML = tabStrip.innerHTML.replace(">Anchor", ">" + anchorText);
        tabStrip.innerHTML = tabStrip.innerHTML.replace(">E-mail", ">" + emailText);

But now with 2011 version of telerik, the above javascipt sets the correct text but when changing the tabs it throws an null exception internally in the telerik javascript. What is the option to set the localized texts to these tab titles now?

2. The tabs are now having the tooltip and how can I localize those tooltips on the tab titles?
3. I want the Existing Anchor label to be text wrapped to display the full text. in some languages it is too long and the text is currently showing only fixed lenght with 3 dots. But I want it to be displayed fully with text wrap. I tried the below, but it breaks the word in the middle. I only want to wrap by breaking by the white space and not the single word. Any workaround for this?

I appreciate your help!

<

 

 

td class="reLabelCell" style="word-wrap: break-word!important;">

 

0
Rumen
Telerik team
answered on 06 Feb 2012, 06:00 PM
Hello,

You do not need any JavaScript code, because you can localize the Tabs inside the Link Manager through the provided resx localization of RadEditor. Just open the
\App_GlobalResources\RadEditor.Dialogs.resx file and modify the values of the following properties:

LinkManager_HyperlinkTab
LinkManager_EmailTab
LinkManager_AnchorTab

You can also increase the size of the tabs by modifying the LinkManager.ascx file and setting the Width properties to the different tabs:

<telerik:RadTabStrip ShowBaseLine="true" ID="LinkManagerTab" runat="server" SelectedIndex="0" MultiPageID="dialogMultiPage">
    <Tabs>
        <telerik:RadTab Width="130" Text="HyperlinkTab" Value="HyperlinkTab">
        </telerik:RadTab>
        <telerik:RadTab Width="130" Text="AnchorTab" Value="AnchorTab">
        </telerik:RadTab>
        <telerik:RadTab Width="130" Text="EmailTab" Value="EmailTab">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>

Best regards,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Sub
Top achievements
Rank 1
answered on 06 Feb 2012, 06:05 PM
Thanks for the response. As I said before, the requirement is to read the localization from our own resource file for maintanance purposes. I want to read a string from our own resoruce file and set the value for those tabs tooltip and text. It used to work before with Javascript in 2008 version of telerik. Please provide any work arounds! Thanks in advance!
0
Rumen
Telerik team
answered on 09 Feb 2012, 01:15 PM
Hi,

Here is an example how to modify the text of the tabstrip tabs using the client side API of RadTabStrip, e.g.

<telerik:RadTabStrip ShowBaseLine="true" ID="LinkManagerTab" runat="server" SelectedIndex="0" MultiPageID="dialogMultiPage">
    <Tabs>
        <telerik:RadTab Text="HyperlinkTab" Value="HyperlinkTab">
        </telerik:RadTab>
        <telerik:RadTab Text="AnchorTab" Value="AnchorTab">
        </telerik:RadTab>
        <telerik:RadTab Text="EmailTab" Value="EmailTab">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<script type="text/javascript">
    function pageLoad() {
        var tabStrip = $find("LinkManagerTab");
        tabStrip.findTabByValue("HyperlinkTab").set_text("testString");
        tabStrip.findTabByValue("AnchorTab").set_text("testString");
        tabStrip.findTabByValue("EmailTab").set_text("testString");
    }
</script>

Another way is to modify the setupChildren function as follow:

this._tab = $find("LinkManagerTab");
this._tab.findTabByValue("HyperlinkTab").set_text("testString1");
this._tab.findTabByValue("AnchorTab").set_text("testString1");
this._tab.findTabByValue("EmailTab").set_text("testString1");


Regards,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Sub
Top achievements
Rank 1
answered on 09 Feb 2012, 06:25 PM
Thanks Rumen for the reply. I already figured out the answer myself. It is good that you provided the same fix. Here is the code to set the tooltip localization string as well.

var

 

 

tabStrip = $find("LinkManagerTab");

 

 

 

tabStrip.findTabByValue("HyperlinkTab").get_linkElement().title = hyperlinkText;

 

tabStrip.findTabByValue(

 

"AnchorTab").get_linkElement().title = anchorText;

 

tabStrip.findTabByValue(

 

"EmailTab").get_linkElement().title = emailText;

Any response for the my 3rd question? Here is the queiston that I have asked:

 

3. I want the Existing Anchor label to be text wrapped to display the full text. In some languages it is too long and the text is currently showing only fixed lenght with 3 dots. But I want it to be displayed fully with text wrap. I tried the below, but it breaks the word in the middle. I only want to wrap by breaking by the white space and not breatking the single word. Any workaround for this?

I appreciate your help!

<

 

td class="reLabelCell" style="word-wrap: break-word!important;">

0
Rumen
Telerik team
answered on 10 Feb 2012, 04:52 PM
Hello,

Did you try to decrease the width size of the ExistingAnchor select dropdown and increase the size of the TD element in which is placed the label? The ellipsis effect is due to the following style text-overflow: ellipsis;.

This is a standard HTML content and you should be able to modify it to achieve your scenario.

If needed I could tell you how to increase the size of RadWindow based Link Manager dialog.

All the best,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Asked by
Sub
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Sub
Top achievements
Rank 1
Share this question
or