application.showFormInDialog convert for web client

Questions, tips and tricks and techniques for scripting in Servoy

application.showFormInDialog convert for web client

Postby kurtbleicken » Sun Jan 06, 2013 8:21 pm

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
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm

Re: application.showFormInDialog convert for web client

Postby grahamg » Sun Jan 06, 2013 9:09 pm

Hi Kurt

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

Code: Select all
   
/**
* @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:

Code: Select all

//    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
Graham Greensall
Worxinfo Ltd
www.worxinfo.com
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Re: application.showFormInDialog convert for web client

Postby kurtbleicken » Mon Jan 07, 2013 8:03 pm

HI Graham,

That's a terrific bit of code. Will save me a lot of time. Thanks. K
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm

Re: application.showFormInDialog convert for web client

Postby kurtbleicken » Fri Jan 11, 2013 9:05 pm

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
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm

Re: application.showFormInDialog convert for web client

Postby mboegem » Fri Jan 11, 2013 10:34 pm

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...
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1748
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: application.showFormInDialog convert for web client

Postby ROCLASI » Fri Jan 11, 2013 11:17 pm

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to Methods

Who is online

Users browsing this forum: No registered users and 3 guests