Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Form Control implementing ModalPopupDialog behaviour View modes: 
User avatar
Member
Member
@davey_lad - 9/4/2012 6:25:07 AM
   
Form Control implementing ModalPopupDialog behaviour
Hi,

does anyone know of any examples or documentation which shows how to create a custom form user control that implements a modal dialog popup (which is styled like other built in popups)

For example, I want to create a multiple document/tree node picker where only the selected/picked nodes are shown by default (as text labels). They can then be selected/deslected by clicking a "modify" button which shows a popup with the necessary interaction UI controls

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 9/4/2012 11:06:31 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
I don't know of any custom examples, but you can take a peek at the selector type controls in your solution to see how the folks at Kentico do it. It is a bit complicated with the querystring hashes and whatnot, but you could choose not to use those.

Come to think of it, I actually did make a custom image upload control for creating and editing square thumbnail versions of images using two fields in a document type. I did use the same modal dialog as kentico uses by copying and modifying the code they use in the built in direct file upload control. So take a look at that control for an example.

User avatar
Member
Member
@davey_lad - 9/4/2012 1:22:13 PM
   
RE:Form Control implementing ModalPopupDialog behaviour
Cheers, i'll take a look

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/5/2012 7:47:38 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
You will need to create some special page to be displayed in popup window. Then set it not to inherit content from master page.

You may also consider using AJAX modal popup feature:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx

You can create custom form control which will be used for some of your Form fields:
http://devnet.kentico.com/docs/devguide/developing_form_controls.htm

Best regards,
Martin Danko

User avatar
Member
Member
@davey_lad - 9/5/2012 7:55:34 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi Martin,

I'm familiar with the ajax toolkit modal popup and have read the developer guide article you reference. However, I would rather use the "built in" popups for consistency.

I had hoped that I could just use the cms:ModalPopupDialog user control in someway to do this but it appears to be more difficult than that.

A detailed article on how to do this would be a really useful addition to the developer guide or someones blog... hint hint :)

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/5/2012 10:39:25 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
ModalPopupDialog was created for internal purposes of Kentico CMS, it can be used by your own but it wasn't created for that.

But you can still take a look at the Code of Kentico and see a few examples how ModalPopupDialog is used in CMS.
For example: YourSite\CMSAdminControls\UI\UniGrid\Controls\AdvancedExport.ascx

User avatar
Member
Member
terrence.porretto-go2vanguard - 9/13/2012 3:35:11 PM
   
RE:Form Control implementing ModalPopupDialog behaviour
So is there any resolve to this?

Like how about when adding a user login you ask during creation, "Launch in a separate window?" making use of internal features.

It's a going trend and should be included or added. I'm taking my stab at it now.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/14/2012 3:48:01 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi,

I am not sure what do you mean.

By user creation do you mean inserting data to the registration form web part?

Where,when and what exactly would you like to launch in a separate window?

Thank you in advance for clarification.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
terrence.porretto-go2vanguard - 9/14/2012 10:43:22 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
OK here is the scenario, anytime an admin creates a user logon web part - they are asked if this will be a popup window or an on-page logon.

If a popup is chosen, then give options how the launch link will look, either a text link or an image.

In my php jquery drupal days, this took less then 10 minutes to even set up a custom popup that wasn't part of the system. I just would apply my id's to the tads and frie away! Pop up logon windows.

My background is in LAMP development for over 10 years, I've just started using Kentico and love it, but not so much the .NET with it's complicated dev environment.

Thanks for any examples or heads up on moving froward.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/17/2012 2:55:24 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi,

I will create a requirment to add this property to the web part.

In the current version you can take advantage of colorbox outside html functionality which allows you to open the html content in the pop-up window.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
@davey_lad - 9/17/2012 3:14:26 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi, just thought I'd point out. My original post was not really related to the live site.. being able to open a popup/modal isn't particulary difficult in this respect and there are numerous ways of doing it.

My original post was related to creating a custom property on a document type, which may point to a custom user control with multiple fields etc. I'd like to be able to access these fields in a modal dialog like other built in Kentico properties.

If you imagine a scenario where you have created such a custom control that may have many fields this could potentially make your "Form" tab look cluttered. Having a "show in popup" (when user is editing in CMS Desk) option on a doc type property would go some way to alleviate clutter.

Hope this makes sense.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/17/2012 6:08:09 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi,

something like this is supported in 7.0 version which was released today.

You can define your custom fields in the document type definition and then take advantage of properties Has depending fields and Depends on another field. Then you can manage visibility of fields. For example user's e-mail field is displayed only in case user insert his name to the user name field. This way you can manage visibility of form and ensure its readability.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
kbachute-paragyte - 2/5/2013 12:25:00 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
In this example they are displaying hard coded controls in dialog but i want to display kentico Form in dialog. can u suggest?

User avatar
Certified Marketer 12
Certified Marketer 12
Ilesh Mistry (MMT Digital's K-Team) - 2/5/2013 5:05:12 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hello

Where are you trying to use this? On the Document Type Form tab? On the Page tab?

If you are looking to add the Kentico Forms into the Dialogs on the Page tab, can you not create a Form selector widget?

Thanks

Ilesh Mistry from MMT Digital's K-Team
Kentico Certified Developer

User avatar
Member
Member
Lokendra Jain - 5/31/2013 4:34:40 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hello All,

I am getting the following error "ReferenceError: modalDialog is not defined"
I have create a custom module inside the CMSModules. This module is used to show all the users. when i click on the add button. this button is used to add the mass users.

Could you please suggest when this error comes and how to resolve it .

Thanks
Lokendra Jain

User avatar
Member
Member
Lokendra Jain - 5/31/2013 4:56:05 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Lokendra Jain wrote: Hello All,

I am getting the following error "ReferenceError: modalDialog is not defined"
I have create a custom module inside the CMSModules. This module is used to show all the users. when i click on the add button I am getting the above mentioned error in error console.

Could you please suggest when this error comes and how to resolve it .

Thanks
Lokendra Jain


User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/27/2013 5:15:07 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi,
Have you found a solution to your issue?
Could you please optionally describe where do you get this error, if there is any stacktrace or if you have checked all the references in your custom module codefile(s)?

Thank you in advance for information.
Regards,
Zdenek

User avatar
Member
Member
Lokendra Jain - 6/28/2013 1:15:24 AM
   
RE:Form Control implementing ModalPopupDialog behaviour
Hi Zdenek ,

We had found the solution by just registered the client script block on page load.

Thanks for your response.


Regards,
Lokendra