AdvMesageBox Multiple content regions

Hi,

I have created a form with two regions and a single IWAdvMessageBoxDialog. Using Async button clicks to change the MsgDlg.ContentRegion field during the async event does not change the contents of the message box. Is it possible to change the content region of the message box during an Async call or do I need to have separate message boxes for each region? I was looking to reduce the number of times a message box had to be rendered.
 
Thanks
 

Modifying the Init() function code seems to fix this.

Do you think removing the line indicated below will have other implications??
 
 
 
    + 'function ' + HTMLName + 'Init(){'#13
    + 'var region = document.getElementById(' + HTMLName + 'ContentRegionID);'#13
    + 'if (region){'#13
    + '  el = document.getElementById("'+HTMLName+'ContentRegion");'#13
    + '  if (el){'#13
////    + '    ' + HTMLName + 'ContentRegionEL = region.innerHTML;'#13
 
//REMOVE THIS LINE SEEMS TO WORK
//ML    +     'if (' + HTMLName + 'ContentRegionEL == null)'#13 So that the content region can change
 
    + '    ' + HTMLName + 'ContentRegionEL = region;'#13
//    + '    el.innerHTML = region.innerHTML;'#13
//    + '    region.innerHTML = "";'#13
    + '    el.appendChild(' + HTMLName + 'ContentRegionEL);'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.top = "0px";'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.left = "0px";'#13
    + '    if (' + HTMLName + 'IsVisible) {'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.visibility = "visible";'#13
    + '    } else {'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.visibility = "hidden";'#13
    + '    }'#13
    + '    }'#13
    + '  }'#13
    + '}'#13;

Simply removing the line will prevent displaying the first ContentRegion control again if necessary.


You can add the following lines of code to make this work correctly:

     + 'function ' + HTMLName + 'Init(){'#13
    + 'var region = document.getElementById(' + HTMLName + 'ContentRegionID);'#13
    + 'if (region){'#13
    + '  el = document.getElementById("'+HTMLName+'ContentRegion");'#13
    + '  if (el){'#13

//    + '    ' + HTMLName + 'ContentRegionEL = region.innerHTML;'#13

    //enable changing the ContentRegion control using asynchronous events
    + '  if (' + HTMLName + 'ContentRegionEL != null) {'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.visibility = "hidden";'#13
    + '    document.body.appendChild(' + HTMLName + 'ContentRegionEL);'#13
    + '  }'#13
    // * //

//    + '  if (' + HTMLName + 'ContentRegionEL == null)'#13
    + '    ' + HTMLName + 'ContentRegionEL = region;'#13

//    + '    el.innerHTML = region.innerHTML;'#13
//    + '    region.innerHTML = "";'#13
    + '    el.appendChild(' + HTMLName + 'ContentRegionEL);'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.top = "0px";'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.left = "0px";'#13

    + '    if (' + HTMLName + 'IsVisible) {'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.visibility = "visible";'#13
    + '    } else {'#13
    + '    ' + HTMLName + 'ContentRegionEL.style.visibility = "hidden";'#13
    + '    }'#13

    + '    }'#13
    + '  }'#13
    + '}'#13;


This update will also be available with the next release of the TMS IW Component Pack.

Bart Holvoet2011-08-10 04:55:34