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…
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');
}