API Questions on Kentico API.
Version 6.x > API > Issue with User Contribution form in a modal window View modes: 
User avatar
Member
Member
tony@3t - 1/20/2012 2:35:30 PM
   
Issue with User Contribution form in a modal window
I created an User Contribution form for user to directly post message on the page. It worked fine when the form in a regular page. After I putting it in a modal page by using Colorbox, the submit would keep the "Please wait.." and circle animation running forever, without postback. I wonder if User Contribution works in a modal window and how can I work around with this issue.

appreciate any tips!

Tony

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 1/23/2012 2:57:55 AM
   
RE:Issue with User Contribution form in a modal window
Hi,

could you please share the code you are using for this?

Thank you.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
tony@3t - 1/24/2012 8:40:18 AM
   
RE:Issue with User Contribution form in a modal window
Hi Ivana,

There is no customized code. I duplicated Contribution List web part, given a different name. Then I inserted the new web part to a page (menu item). Submit worked. But when I opened the same page in a modal page by using Color Box (http://jacklmoore.com/colorbox/). Submit would just keep waiting with that looping animation. Nothing changes about the page, just it sits on current page within a smaller window.

Any ideas?

Thanks!

Tony

User avatar
Member
Member
tony@3t - 1/30/2012 10:01:51 AM
   
RE:Issue with User Contribution form in a modal window
Does anyone has any ideas?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 2/3/2012 4:23:03 AM
   
RE:Issue with User Contribution form in a modal window
Hi,

I tried to open user contribution page (with a default user contribution web part) and it was opened correctly as a new iframe in a modal window. I was able to edit contribution as well. Tested on 6.0.15 Here is my code:


// inserted in the editable text web part:

<p>
<a class="iframe" href="http://<domain>/Examples/Web-parts/User-contributions/Edit-contribution.aspx">User contribution (Iframe)</a></p>

// script in the head section on master page

<link rel="stylesheet" href="http://<domain>/CMSScripts/jquery/colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://<domain>/CMSScripts/jquery/jquery-colorbox.js"></script>


<script>
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});

//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>




I hope it helps.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
tony@3t - 2/6/2012 2:05:21 PM
   
RE:Issue with User Contribution form in a modal window
Hi Ivana,

Thanks for digging through it! The trick is the "iframe" setting. My original iframe setting was false and it worked fine with biz form. However for User Contribution, iframe has to be set as true is order to get it worked.

Thanks!

Tony