JSWindow.ModalDialog on top of JSWindow.ModalDialog

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

JSWindow.ModalDialog on top of JSWindow.ModalDialog

Postby john.allen » Wed Dec 14, 2011 5:09 am

In Servoy 6.0.3 the code below works fine in Developer/SmartClient but not in Developer/WebClient. In a nutshell I am creating a JSWindow.MODAL_DIALOG, taking some actions there, creating another JSWindow.MODAL_DIALOG while hiding the first one, taking some actions there in that 2nd one, closing (destroying) that 2nd JSWindow, getting back that 1st JSWindow, taking some more actions and then finally closing out that first JSWindow. All of that works fine in Smart Client. In Web client when hiding the first JSWindow and going to the second one both windows disappear. Below is a slightly abbreviated version of my three functions but with all the main actions.

I keep messing around with the order of actions (creating/hiding/destroying windows), re-reading the wiki but just can't seem to get this to work in webclient, yet works fine in smart client. Any help greatly appreciated...

Code: Select all
function onActionViewLocation(event) {
   databaseManager.startTransaction();
   linvmaster_to_linvlocationaccess.newRecord();
   globals.g_locationAccessID = linvmaster_to_linvlocationaccess.linvlocationaccess_id
   forms.linvlocationaccess.controller.loadRecords(globals.g_locationAccessID);
   var InvActWindow = application.createWindow("InventoryAction", JSWindow.MODAL_DIALOG);
   InvActWindow.title = 'Action Taken with Inventory';
   InvActWindow.setSize(900,250);
   InvActWindow.setLocation(100,80);
   InvActWindow.resizable = true;
   forms.linvlocationaccess.controller.show(InvActWindow);
   forms.linvlocationaccess.elements.purpose.requestFocus();
}
function onActionSaveAndGoToLoc(event) {//In this function is where things go wrong in Webclient.
   databaseManager.commitTransaction(true);
   var InvLocWindow = application.createWindow("InventoryLocation", JSWindow.MODAL_DIALOG);
   InvLocWindow.title = 'Tank Inventory Location';
   InvLocWindow.setSize(800,450);
   InvLocWindow.setLocation(100,80);
   InvLocWindow.resizable = true;
   forms.tanklocation.elements.btn_delInv.visible = false;
   forms.tanklocation.controller.loadRecords(linvlocationaccess_to_linv);
   controller.getWindow().hide();
   forms.tanklocation.controller.show(InvLocWindow);
   }
}

function CopyLocationAndClose(event) {
   var location = 'tank:' + tank + ' sleeve:' + sleeve + ' pie:' + pie + ' vialamt:' + vialamt + ' cells in vial:' + vialcell;
   application.setClipboardContent(location);
   controller.getWindow().destroy();
   forms.linvlocationaccess.elements.btn_Close.visible = true;
   forms.linvlocationaccess.elements.btn_cancelLocation.visible = false;
   forms.linvlocationaccess.elements.btn_saveToLocation.visible = false;
   application.getWindow('InvActWindow');
   forms.linvlocationaccess.controller.show('InvActWindow');
}
John Allen
Stanford University
john.allen
 
Posts: 515
Joined: Wed Jul 02, 2003 10:07 pm
Location: Stanford CA USA

Re: JSWindow.ModalDialog on top of JSWindow.ModalDialog

Postby Yeroc » Wed Dec 14, 2011 10:12 pm

Sounds like you're running into a bug we reported a while ago (SVY-1154) which will be fixed for v6.0.4.
Yeroc
 
Posts: 109
Joined: Tue Aug 12, 2008 1:12 am
Location: Calgary, AB, Canada

Re: JSWindow.ModalDialog on top of JSWindow.ModalDialog

Postby john.allen » Wed Dec 14, 2011 10:42 pm

Oh! Many thanks! Yes reading your bug report it does sound pretty much the same.

I was just thinking it was my ignorance with WebClient and/or Servoy 6 (I've just started doing webclient development). In fact I was in the process of seeing if the ServoyForge showFormInModalDialog will work better. I think I'll go ahead with that anyway just to see.
John Allen
Stanford University
john.allen
 
Posts: 515
Joined: Wed Jul 02, 2003 10:07 pm
Location: Stanford CA USA


Return to Web Development

Who is online

Users browsing this forum: No registered users and 7 guests