application.showFormInDialog convert for web client

Can’t get this to work. I’m sure it’s something very simple. Just trying to replace application.showFormInDialog with a version that works on web client.

my old method:
//application.showFormInDialog( forms.staff_view_show_team_results, -1, -1, 900, 400, ‘my team’, true, false, ‘’, true)

new method:
var win = application.createWindow(“staff_view_show_team_results”,JSWindow.MODAL_DIALOG,“ca_listview”)
win.setInitialBounds(-1, -1, 900, 400);
win.title = “How’s my team doing?”;
controller.show(win);

Thanks. K

Hi Kurt

An easy way is to use a global method that can display a variety of popup Forms as follows:

/**
 * @param {String} pForm
 * @properties={typeid:24,uuid:"647E8EDB-5B56-4AF0-AF24-D075EB381284"}
 */
function g_POPshow(pForm) {
	//	121111
	var vWindow	= application.createWindow('POP',JSWindow.MODAL_DIALOG);
	vWindow.show(pForm);
}

The global function can simply be called by:

//    insert code to load record(s) into the required Form
//    then just this one-line that provides the Forn name to be displayed
globals.g_POPshow('contacts_p_AddEdit')

HTH

HI Graham,

That’s a terrific bit of code. Will save me a lot of time. Thanks. K

Another question. That code opens up a popup form, formerly a FID. But if I want to leave that first form in place and open a second, for example, an error message, if I use the code to open the second popup it automatically closes the first.

My goal would be to keep the first popup in place, open the warning message, then return the user to the first form for fixing the problem.

Suggestions would be appreciated. K

Hi Kurt,

you also might want to take a log at the modDialog project on servoy-forge.
This servoy-module makes ‘dialoging’ in the web-client easy…

Hi Kurt,

The trick of getting a second dialog is to use unique window names. So if you want to show another dialog (be it modal or not) is to use a unique name for it.
And yes, the dialog module makes things easy for the standard (error/warning/question/etc) dialogs and form-in-modal-dialogs. It works the same for both web- and smart client.

Hope this helps.