smart client -> webclient

Forum to discuss the Web client version of Servoy.

smart client -> webclient

Postby Harjo » Thu Aug 26, 2010 2:15 pm

We have a smart-client solution which we want to convert to webclient.

the solution is FULL of code like this:

Code: Select all
var vAnswer = plugins.dialogs.showWarningDialog('i18n:1.warning', 'i18n:1.message.deleterecord', 'i18n:1.ok', 'i18n:1.cancel')
if (vAnswer == i18n.getI18NMessage('i18n:1.ok')) {
   //do my stuff here
}


Also other plugins.dialogs, like INFO, ERROR are used a lot in the middle of large methods, which does not work in the webclient. :-(

Before we start, what is the best, easiest & quickest way to convert such code to be webcomplaint?? Are there any tricks/tips?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: smart client -> webclient

Postby Hans Nieuwenhuis » Thu Aug 26, 2010 3:57 pm

Hi Harjo,

In our framework ( built together with Servoy ) we now use a separate module
that displays dialogs using the solution model to create forms and formindialog to display them.
we replaced all calls to the dialog plugin with calls to this methods in this module.

And now the dialogs are displayed in the same way in Web- and Smart client.

Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: smart client -> webclient

Postby Harjo » Thu Aug 26, 2010 5:30 pm

yes, I know that is possible, but you can't just replace that single line of code, with the one build for webclient.
because in webclient you use FormInDialog right? and your method has to end with that showFormInDialog. right?

so that's a LOT of work, to rework all those methods... Or there must be some simpler way
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: smart client -> webclient

Postby victor.rojo » Fri Aug 27, 2010 9:39 am

And don't forget that in WC the code after the showFormInDialog continues to execute, so you must create a callback function to execute after the dialog close (if the code depends of the button pressed).
So yes a LOT of work...
Best regards/Un saludo,

Victor Rojo
Developer

NeoCursar, S.L. - Developers Team
--
Servoy 5.2.8 - build 1016 / Version: 6.0.2 - build 1222
Mac OS X 10.7
victor.rojo
 
Posts: 74
Joined: Mon Jan 11, 2010 1:49 pm

Re: smart client -> webclient

Postby pbakker » Fri Aug 27, 2010 9:56 am

It's possible to get the same behavior in the Web Client for dialogs by utilizing so-called Continuations in scripting, see slide 24 of the JavaScript Expert webinar slides.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: smart client -> webclient

Postby Hans Nieuwenhuis » Fri Aug 27, 2010 10:08 am

That is correct Paul and that is how our framework handles this.

So, if you have created the methods for the new dialogs it is simply a replace action.
plugins.dialogs... to svy_dialogs... ( the syntax is exactly the same in our framework)

Regards.
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: smart client -> webclient

Postby Harjo » Fri Aug 27, 2010 10:12 am

aha! Continuations!

THAT"S interesting! never saw this.

Do you have some more examples on how to implement this?
the only one I found in the slide is: alert = function(text){plugins.dialogs.showInfoDialog('Alert',text,'Ok')}
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: smart client -> webclient

Postby pbakker » Fri Aug 27, 2010 10:16 am

the only one I found in the slide is: alert = function(text){plugins.dialogs.showInfoDialog('Alert',text,'Ok')}


Then you're looking at the wrong slide :) That is slide 25, not 24.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: smart client -> webclient

Postby Harjo » Fri Aug 27, 2010 10:19 am

:-) yes I know, saw that one too, but I dont know how to implement this in an existing method....
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: smart client -> webclient

Postby victor.rojo » Fri Aug 27, 2010 10:35 am

pbakker wrote:It's possible to get the same behavior in the Web Client for dialogs by utilizing so-called Continuations in scripting, see slide 24 of the JavaScript Expert webinar slides.

Paul

Maybe some reference to this would be in the wiki or in the function documentation...
If we knew that before we wouldn´t have wasted hours refactoring the code...
Best regards/Un saludo,

Victor Rojo
Developer

NeoCursar, S.L. - Developers Team
--
Servoy 5.2.8 - build 1016 / Version: 6.0.2 - build 1222
Mac OS X 10.7
victor.rojo
 
Posts: 74
Joined: Mon Jan 11, 2010 1:49 pm

Re: smart client -> webclient

Postby Infop » Sat Sep 18, 2010 10:57 am

Hi Paul,

pbakker wrote:It's possible to get the same behavior in the Web Client for dialogs by utilizing so-called Continuations in scripting, see slide 24 of the JavaScript Expert webinar slides.

Paul


The above mentioned link is not working. Can you please, look in to the same.

Thanks,
User avatar
Infop
 
Posts: 151
Joined: Fri Nov 30, 2007 3:00 pm

Re: smart client -> webclient

Postby Hans Nieuwenhuis » Sat Sep 18, 2010 11:02 am

Hi, i could download it.

See attachment

Regards,
You do not have the required permissions to view the files attached to this post.
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: smart client -> webclient

Postby Infop » Sat Sep 18, 2010 4:03 pm

Hans Nieuwenhuis wrote:Hi, i could download it.

See attachment

Regards,



Hi Hans,

Thanks. Can you please, provide the doc or docx version. I don't have OpenOffice with me and with MS Word, the file is not opening.

Thanks
User avatar
Infop
 
Posts: 151
Joined: Fri Nov 30, 2007 3:00 pm

Re: smart client -> webclient

Postby Thomas Parry » Sat Sep 18, 2010 6:16 pm

I could download it but not open it with openoffice either...must be bad data by now.
Is it on the wiki anywhere?
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: smart client -> webclient

Postby Hans Nieuwenhuis » Sat Sep 18, 2010 7:19 pm

Here is a pdf
You do not have the required permissions to view the files attached to this post.
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Next

Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 9 guests