widget - detail in window
Hello,
Am trying to developer a widget and i need to show the item detail in a Dialog/Window/RadWindow.
What is the best way to do this fully integrated with sitefinity (design and security) ?
In the developer guide of Beta 2 exists the method RegisterDialog, can i use it ? How ?
thanks,
Hello Joana,
You can use RadWindow control and inside it call a page or another control where you get the Content property of a Content object - NewsItem, ContentItem, EventsItem etc.
sample
var app = App.WorkWith().NewsItems().Get();
foreach
(NewsItem itm
in
app)
var cnt = itm.Content;
Response.Write(cnt);
Hi,
The control that i'm trying to implement has an proper dataprovider.
I know that i can create a aspx/control and then use RadWindow but in this way i will not be able to fully integrate with sitefinity. for example:
- i put my control in one page that is not visible to "Everyone" how to develop the detail Dialog and prevent unauthorized access ?
- how to call the dialog and this dialog have the same design that the rest of the site?
I don't know if this is a trivial question because this is may first contact with sitefinity development.
Hello Joana,
There is a built-in control PromptDialog that you can use. Inside the CustomTemplate
you can add a control/s you want to see.
<
sf:ResourceLinks
id
=
"resourcesLinks"
runat
=
"server"
Theme
=
"Default"
UseEmbeddedThemes
=
"true"
>
<
sf:ResourceFile
JavaScriptLibrary
=
"JQuery"
/>
<
sitefinity:ResourceFile
Name
=
"Skins/PromptDialog.css"
/>
</
sf:ResourceLinks
>
<
sitefinity:PromptDialog
runat
=
"server"
id
=
"promptDialog"
Width
=
"150"
Height
=
"150"
Mode
=
"Custom"
AllowCloseButton
=
"true"
ShowOnLoad
=
"false"
Title
=
"just a test"
>
<
CustomTemplate
>
<
asp:Literal
runat
=
"server"
ID
=
"test1"
Text
=
"Hello there"
/>
</
CustomTemplate
>
<
Commands
>
<
sf:CommandToolboxItem
Text
=
"Done"
CommandName
=
"ok"
CommandType
=
"CreateButton"
WrapperTagName
=
"LI"
></
sf:CommandToolboxItem
>
<
sf:CommandToolboxItem
Text
=
"Cancel"
CommandName
=
"cancel"
CommandType
=
"CancelButton"
WrapperTagName
=
"LI"
></
sf:CommandToolboxItem
>
</
Commands
>
</
sitefinity:PromptDialog
>
<
asp:LinkButton
runat
=
"server"
ID
=
"testbutton"
OnClientClick
=
"showPropmpt();return false;"
Text
=
"call function"
/>
<
script
type
=
"text/javascript"
>
function showPropmpt()
var propmptDialog = $find('<%=promptDialog.ClientID%>');
propmptDialog.show_prompt();
</
script
>
Hi,
I don't have the Mode=
"Custom"
i only have the options "Confirm" and "Input".
Hello Joana,
It looks like we have implemented the mode after the beta, so you can use this code once we release the RC or use RadWindow control as a dialog to open a cms page on which you can set permissions or a physical file from the project.
Greetings,
Ivan Dimitrov
the Telerik team
Hi Ivan
Many thanks.
As I’m new to SF, could you please explain where does this code go? I tried to create custom widget with this code but no luck.
Many Thanks
Regards
Hello,
You can create a simple user control and put the logic there.
Regards,
Ivan Dimitrov
the Telerik team