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

[Solved] Pass client data to FileBrowser

3 Answers 143 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 Apr 2008, 05:57 AM
Is there a way to pass some client data to the instance of the FileBrowser?

I have defined a file browser that inherits from FileBrowserContentProvider and I would like to pass some information into the file browser for use when processing uploads.

I know that we pass the type name of the file browser to the editor and it is responsible for creating the file browser instance.

Mike

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 08 Apr 2008, 04:07 PM
Hi Michael,

In general, there is no way to pass client data to the FileBrowserContentProvider, but please, give us more details about your current scenario and if the desired behavior can be achieved, we will do our best to provide you with a solution.


Best regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael
Top achievements
Rank 1
answered on 11 Apr 2008, 07:56 PM
One scenario is that I associate uploads with the 'page' being edited by the editor control.

If the page already exists, then I am passing in the page id through the viewpaths, when a file is uploaded a record is created in the database which references the page id.

If no page exists, i.e. creating a new page, then there is no page id to associate uploads with, so I want to pass a temporary unique id to the file browser, the file browser would then associate any new uploads with this unique id. When the user clicks on the save button on the page that contains the editor control I can save the 'page' (which will give me the page id) and then I can update all of the upload records to replace the temporary unique id with the persistent page id.

I do not want to create a page just so I can get a unique page id before the user actually saves the page. I know I could encode something in the ViewPaths to tell it I am passing the unqiue id rather than a 'real' path but that is too much of a hack when the need to support passing client data seems justifiable.

Does that make sense? Since we already pass in ViewPaths, etc. it seems resonable to have a property for client data. It would allow the file browser to be much more extensible.

Mike
0
George
Telerik team
answered on 15 Apr 2008, 04:07 PM
Hi Michael,

Thank you for the detailed information - your scenario makes sens.
 
I logged it in our ToDo list and we will do our best to implement the wanted functionality for one of the future updates. Unfortunately, we cannot provide you with an exact ETA.

Your points were updated.

Best regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Michael
Top achievements
Rank 1
Answers by
George
Telerik team
Michael
Top achievements
Rank 1
Share this question
or