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

standalone image dialog startup properties

9 Answers 168 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 07 Feb 2009, 08:47 PM
Hi

I have a site with thumbnail gallery already put together.  Now I'd like to add the standalone image dialog such that:  user clicks thumbnail, full size image opens in Advanced Editor.   I just want users to be able to zoom and rotate - no other browse, upload, delete etc is necessary.

Is this possible and if so can you point me in a general direction as far as what properties to set on the image dialog?

Thanks!
Mark

9 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Feb 2009, 06:27 PM
Hello Mark,

Please, see the following KB article on the subject:
Using the Image and Document managers outside RadEditor.

To hide the desired buttons you should set the ExternalDialogsPath property and copy the external dialogs folder to your project. After that hide the buttons in the same way as it is demonstrated in this help article: ExternalDialogsPath property, e.g. set style="display:none" to the button tags.

You can set the ExternalDialogsPath property in a standalone image manager with the following code:

DialogDefinition imageManager = new DialogDefinition(typeof(ImageManagerDialog), imageManagerParameters); 
imageManager.Parameters["ExternalDialogsPath"] = "~/EditorDialogs/";

with a slash / after the ~/EditorDialog string.


Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stuart
Top achievements
Rank 1
answered on 06 May 2009, 10:52 AM
Is there an example of this for the flashManager?
0
Rumen
Telerik team
answered on 11 May 2009, 09:59 AM
Hi Stuart,

The solution is very similar to this one that applies to the Document manager. Here is an example:

Default.aspx:
<script type="text/javascript">     
function FlashManagerFunction(sender, args)     
{     
    var txt = $get('<%= TextBox1.ClientID %>');     
    var selectedItem = args.get_value();     
    txt.value = selectedItem; 
}     
  
function OpenFlashManager()   
{   
    var args = new Telerik.Web.UI.EditorCommandEventArgs("FlashManager"nulldocument.createElement("a"));   
    args.CssClasses = [];   
       
    $find('<%= DialogOpener1.ClientID %>').open('FlashManager', args);   
}   
</script>    
            
<asp:TextBox runat="server" ID="TextBox1" Width="400px"></asp:TextBox><br />    
<telerik:dialogopener runat="server" id="DialogOpener1"></telerik:dialogopener>    
<button onclick="OpenFlashManager();return false;">Open Flash Manager</button>   

Default.aspx.cs

using Telerik.Web.UI; 
using Telerik.Web.UI.Editor.DialogControls; 
... 
 
protected void Page_Load(object sender, EventArgs e) 
    FileManagerDialogParameters flashManagerParameters = new FileManagerDialogParameters(); 
    flashManagerParameters.ViewPaths = new string[] { "~/Documents" }; 
    flashManagerParameters.UploadPaths = new string[] { "~/Documents" }; 
    flashManagerParameters.DeletePaths = new string[] { "~/Documents" }; 
    flashManagerParameters.MaxUploadFileSize = 5000000; 
 
    DialogDefinition flashManager = new DialogDefinition(typeof(FlashManagerDialog), flashManagerParameters); 
    flashManager.ClientCallbackFunction = "FlashManagerFunction"
    flashManager.Width = Unit.Pixel(694); 
    flashManager.Height = Unit.Pixel(440); 
 
    DialogOpener1.DialogDefinitions.Add("FlashManager", flashManager); 
 


All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Pierre
Top achievements
Rank 1
answered on 22 Jan 2010, 05:09 PM
Hi Rumen,

I use similar feature in my sf cms solution. Could you explain how to pass one external parameter from page to server side code. I need to create customised folders using one page parameter. I have tested using one input hidden field in the page or other stardard fields like label and passing in the fash manager function but i have one alert demanding some registrering in web config. Exist some way to pass one extra parameter for page to server side code to use during imagemanager construction. 

  <script type="text/javascript">  
       var currentTextBoxID;  
       var hiddenID;
    function ImageManagerFunction(sender, args)    
    {    
        var selectedItem = args.get_value();    
        var txt = $get(currentTextBoxID);         
        var path = args.value.getAttribute("src",2);  
        txt.value = path;  
        var hidden=$get(hiddenID); 
        hiden.value=true; 
    }  
          
    </script> 
 
    <asp:TextBox ID="Linkthumb6" runat="server"></asp:TextBox> 
    <telerik:dialogopener runat="server" id="DialogOpener1" >    
    </telerik:dialogopener> 
    <input id="HiddenField" type="hidden" runat="server" Value="false"/>
 
    <button onclick="hiddenID='<%= HiddenField.ClientID %>';currentTextBoxID='<%= Linkthumb6.ClientID %>';$find('<%= DialogOpener1.ClientID %>').open('ImageManager');return false;">Select</button> 
     
Thanks, Romi
0
Rumen
Telerik team
answered on 27 Jan 2010, 01:50 PM
Hi Pierre,

If you want to pass information from the client to the server using a hiddenfield element then you should perform a postback.

Another approach is to use Session to store information from the client and after a postback to retrieve it on the server.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pierre
Top achievements
Rank 1
answered on 27 Jan 2010, 02:03 PM
Hi Rumen,

Umm, Ok but how to define my session field using javascript client side?. Could you add one simple sample please. Thanks.
0
Rumen
Telerik team
answered on 01 Feb 2010, 09:13 AM
Hi Pierre,

Please find attached a sample project which demonstrates how to pass a parameter via the query string and obtain it from the standalone image dialog using Request.QueryString["MyQueryString"];

To set an additional querystring use the set_additionalQueryString method, e.g.

var dialogOpener = $find('<%= DialogOpener1.ClientID %>');
dialogOpener.set_additionalQueryString("&MyQueryString=Test123");

To obtain the querystring you should register the external dialogs, open the \EditorDialogs\FileBrowser.ascx external dialog and add a reference to a newly created UserControl. In the PageLoad event of the UserControl, you will be able to obtain the querystring information using:

Request.QueryString["MyQueryString"];

The scenario is very similar to the explained one in this KB article: Displaying single upload control in the FileBrowser Upload manager.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Yvonne Patakidou
Top achievements
Rank 1
answered on 08 Apr 2010, 05:55 PM

Dear Rumen,

 

I was succesfully using your code, but I want to add this line of code in the codebehind - so to open with classic dialogs.

 DialogOpener1.UseClassicDialogs = true

But when I choose an image to insert I get an javascript error Line: 175 Function expected..Also when I choose an image and i click on image editor javascript error occurs . It cannot find dialogparameters
I believe this is a bug.

Thanks in advance
Yvonne
0
Rumen
Telerik team
answered on 09 Apr 2010, 07:54 AM
Hello Yvonne,

Thank you for reporting this problem.

I was able to reproduce it and logged it for research and fixing in our PITS system. You can check the status of the issue there.

I also updated your Telerik points for your bug report.


Regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Mark
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Stuart
Top achievements
Rank 1
Pierre
Top achievements
Rank 1
Yvonne Patakidou
Top achievements
Rank 1
Share this question
or