Page 1 of 1

JQDialog and HTML Template used on IWAppform

PostPosted: 17 Oct 2016 02:57
by Blackwellsimon
Hi,

I am having a problem with the JQDialog when IWEdits or JQEdits are used on the dialog (as in the Login Dialog demo). If there is a HTML template linked to the IWAppform layout manager, the IWEdits all return empty, even though values have been captured. If you remove the HTML or just rename it then everything works as expected and you can use the values entered in to the IWEdits on the JQDialog.

There does seem to be a small difference on the scripts added when then the IWAppform is loaded in the browser.

With a template applied
Code: Select all
$(function(){$("#DLGENTRY").dialog({buttons:[{id:"DLGENTRY_0",text:"Accept",click:function (){   var url = "&ajaxevent=JQDialogOptions.Buttons.Items[0].OnClick";   executeAjaxEvent(url,DLGENTRYIWCL,"DLGENTRY.DoAjaxRequest",true,null,true); } },{id:"DLGENTRY_1",text:"Cancel",click:function (){   var url = "&ajaxevent=JQDialogOptions.Buttons.Items[1].OnClick";   executeAjaxEvent(url,DLGENTRYIWCL,"DLGENTRY.DoAjaxRequest",true,null,true); } }],width:385,height:225,title:"<span id=\"DLGENTRY_TITLETEXT\" >Dialog Entry<\/span>",autoOpen:false,open:function (event, ui){$('input[name="DLGENTRY_VISIBLE"]').val(true);AddChangedControl("DLGENTRY_VISIBLE");CGIWUpdateRects(this);},close:function (event, ui){$('input[name="DLGENTRY_VISIBLE"]').val(false);AddChangedControl("DLGENTRY_VISIBLE");}});$("#DLGENTRY").parent().css({"position":"absolute"});});
var DLGENTRYIWCL = null;


function InitIWCLObjects() {
DLGENTRYIWCL = NewIWCL(IWCLForm,"DLGENTRY",false);
if (DLGENTRYIWCL) {DLGENTRYIWCL.OnCGResize = function(ARect) {this.SetRect(ARect); if (CGTriggerEvent) {  ARect.Width = $(this).width();  ARect.Height = $(this).height(); } return true; }}


With no template applied
Code: Select all
function InitIWCLObjects() {
$(function(){$("#DLGENTRY").dialog({buttons:[{id:"DLGENTRY_0",text:"Accept",click:function (){   var url = "&ajaxevent=JQDialogOptions.Buttons.Items[0].OnClick";   executeAjaxEvent(url,DLGENTRYIWCL,"DLGENTRY.DoAjaxRequest",true,null,true); } },{id:"DLGENTRY_1",text:"Cancel",click:function (){   var url = "&ajaxevent=JQDialogOptions.Buttons.Items[1].OnClick";   executeAjaxEvent(url,DLGENTRYIWCL,"DLGENTRY.DoAjaxRequest",true,null,true); } }],width:385,height:225,title:"<span id=\"DLGENTRY_TITLETEXT\" >Dialog Entry<\/span>",autoOpen:false,open:function (event, ui){$('input[name="DLGENTRY_VISIBLE"]').val(true);AddChangedControl("DLGENTRY_VISIBLE");CGIWUpdateRects(this);},close:function (event, ui){$('input[name="DLGENTRY_VISIBLE"]').val(false);AddChangedControl("DLGENTRY_VISIBLE");}});$("#DLGENTRY").parent().css({"position":"absolute"});});

DLGENTRYIWCL = NewIWCL(IWCLForm,"DLGENTRY",false);
var parDLGENTRY = $("#DLGENTRY").parent(); parDLGENTRY.hidden = parDLGENTRY.css("display") == "none"; if (parDLGENTRY.hidden) parDLGENTRY.css("display","block");
DLGENTRYIWCL = NewIWCL(IWCLForm,"DLGENTRY",false);
if (DLGENTRYIWCL) {DLGENTRYIWCL.BorderWidthPixels = 0;}
if (DLGENTRYIWCL) {DLGENTRYIWCL.OnCGResize = function(ARect) {this.SetRect(ARect); if (CGTriggerEvent) {  ARect.Width = $(this).width();  ARect.Height = $(this).height(); } return true; }}


Anyone noticed this problem before and have a solution

Thanks
Simon

CGDevtools: 3.0.0.0 also tried 3.0.0.65 but same thing
Intraweb 12.2.32

Re: JQDialog and HTML Template used on IWAppform

PostPosted: 17 Oct 2016 03:18
by Blackwellsimon
Nothing like posting a reply to your own question...

The only way I can get things to work is before the dialog is made visible is to clear out the layout manager being used

Code: Select all
self.layoutmgr := nil


then when the form is hidden (visible := false ) is to reply the template

Code: Select all
self.layoutmgr := iwtemplate


Would be good to know why the layout manager is mucking things up.

Simon

Re: JQDialog and HTML Template used on IWAppform

PostPosted: 17 Oct 2016 14:27
by Jorge Sousa
Hello

Would be good to know why the layout manager is mucking things up.


Please submit a test case, we have no idea what your template is.

Re: JQDialog and HTML Template used on IWAppform

PostPosted: 17 Oct 2016 17:40
by Blackwellsimon
Hi Jorge,

Attached is a demo example with the basic HTML template attached.

Thanks
Simon