smart client vs. web client

I have a complex solution in Servoy 3.5.7 deployed for Smart Client.
Now I have a big problem in speed for the clients opening the solution by a remote vpn connection. I tried a lot to increase the performance, but without significant result.
Working with the solution over a vpn connection is impossible. Loading forms takes too much time.
I also tried to start the solution in a browser as a Web Client. That is much faster and absolutly usable in speed. The plan is now to modify the solution for using in Web Client. Many functions don’t work in the Web Client as in the Smart Client and I searched a lot for information what the difference is and what I have to do for a Web Client solution. Of course I read the Servoy doku, Nicolas presentation pdf’s from the Servoy Dev. Conf. and more.
That all helps, but where can I get more information about developing a solution for Web Client?
I have issues and questions for ‘onHide’ function on dialog forms, closing a dialog by a selfmade button, writing formatable text in html_aerea, printing, showing a printpreview and so on.

Thank you all for help and merry christmas :-)

Thomas

Hi Thomas

Can you be more specific about the issues you have?

I am using onHide, self-made Close buttons, Printing and Print Preview in WebClient solutions and can’t think of any real issues compared with Rich Client. Do you have some code examples that are causing a problem.

Regards

Hi Graham,
thank you for your fast reply. I will do that, but this take a little time, because I will discribe it as well as I can.
First of all one example:

  • I open a form in dialog (selfmade dialog instead of the plugin dialogs)
  • onShow set globals.check_hide to 1
  • onHide method is set in form properties
If (globals.check_hide == 1) {
return false;
}

In smart client it works well, but in web client I always can close the window by system close button and not by the selfmade button.

  • I have buttons on that form: ‘ok’ and ‘cancel’
  • the onAction method of the buttons is:
var vBtn = elements[application.getMethodTriggerElementName()].text;
if (vBtn != undefined){
globals.check_hide = null;
...some code for elements on the form...
if (globals.ClickedButton == vBtn) //the btn I expect is clicked
{
eval (globals.MethodToExecute); //the method I will execute
}
globals.MethodToExecute = null;
globals.ClickedButton = null;
application.closeFormDialog('dialog');
}

The method is executed, but the dialog window is still open.
The solution is in Servoy 3.5.7. I tried to migrate to Servoy 4.1, but I got to many errors and have to fix that first.

Thomas

Hi Thomas

Following code - probably ‘borrowed’ from the Forum - works for me using showForminDialog:

onShow

trigger = null;

onHide

if (!trigger) 
{
	return false;
}
else
{
	trigger = "ok"; 
	application.closeFormDialog('AddEdit')

}

Close button code

	trigger = "ok"; 
	application.closeFormDialog('AddEdit')

I also tend to build a single popup window based on a ‘system’ table then just add new Forms in a Tab Panel as required - then you only need one set of onShow/onHide/CloseButton code.

Hope this helps

Hi Graham,
I made some changes like your post, but onHide and close by buttonmethod of individual forms as showFormInDialog doesn’t work!

Happy New Year
Thomas

Gutes Neues Jahr

Can you post the code that is not working - probably just a minor difference somewhere.

Hi Thomas,

For the close button set the variable to NULL, then it should work.

On Servoy 4.1 my ‘onHide’ method is:

//onShow method sets globale to 1!
if(globals.gCheck_onHide == 1){
return false;
}

The method is working well in smart client. The dialog form cannot be closed by the system close button, but in webclient the dialog form closes by the system button.

My method for the individual buttons is:

var vBtn = elements[application.getMethodTriggerElementName()].text;
	if (vBtn) {
		globals.gCheck_onHide = null;
		m_clear_all_text(); //clears the indiv. textmessage
		m_hide_all_icons(); //hides all indiv. icons
		//clicked btn text in globale for execute methode
		globals.gClickedButton = vBtn;
		//executes methode in globale
		if(globals.gFunctionToExecute) {
			eval(globals.gFunctionToExecute);
			globals.gFunctionToExecute = null;
		}
		else {
			globals.gClickedButton = null;
		}
		application.closeFormDialog("dialog");
	}

The method is also working well in smart client, but in the webclient the dialog form is still open with an empty window.

Thomas

what do you mean with the system close button?

I can imagine het is talking about the window (x) close button…

of the browser it self? that is an event that cant be easily stopped so that it doesnt happen

Yes I mean the window (x) close button. In smart client I not allow closing the window clicking that button by the onHide method. And on webclient? How can I stop easily that event? Why is the window not closing by application.closeFormDialog()?

now to be really sure what we talk about

Do you mean the X of the browser window itself?
Or the modal window that you see inside the browser window that acts as a modal dialog in the browser window?

That modal window X thats inside the browser window, should be blocked like in the smart client
But if you close the real browser window or a tab in the current browsers then this could be a problem. Because those are not easily blocked.

Also closeFormInDialog will close the modal window inside the browser window. That should work fine.

I’m using FIDs in several solutions in web client and they work nicely, can you post your code so that we can check if there’s something wrong? Could you also try to use a different web browser? Maybe the issue is browser dependent.

Hi guys,

I have detected the problem in corporation with Thomas Ledergerber! In that function is the beginning of the issue:

application.showFormInDialog(forms.test_dialog,-1,-1,-1,-1,'test',false,false,'dialog',true);

I have changed the last parameter [modal] from ‘false’ to ‘true’ and now it works!
Sorry, but without the help of Thomas we would talk at cross-purposes for a long time…

Thank you all!

Furthermore I have some questions:
How do you create a print preview for webclient?
How do you format text in a html-area manually in webclient?

Thomas

tgs:
How do you create a print preview for webclient?

I’m quite in a hurry but I can answer this one: just call print preview as you would do on smart client and you’ll get a PDF print in a new browser window.

Hi Nicola,

just call print preview as you would do on smart client and you’ll get a PDF print in a new browser window.

on Mac with Safari the generated pdf by the controller.showPrintPreview() function store a file (default direction) and don’t open it automatically in a new browser window. Is there a way to display the pdf in a servoy-form with buttons like ‘print’, ‘mail’, ‘cancel’?

I’m using FIDs in several solutions in web client and they work nicely

In my solution two or more forms in dialog have to be open at the same time. That won’t work in webclient. Do I have to create FID’s for each dialogform by using application.createNewFormInstance()?

Thomas

the same form shown twice in multiply dialogs?
thats also not possible in smart client.
You have to create a new instance of the form then yes.

Hi Johan,

of course different forms in dialogs!
What do you say about how to print and create a printpreview in webclient?

Thomas

you want to display the pdf (the output) inside the web browser with print buttons??
thats not possible, the pdf will be opened by the reader (in the browser or externally) and there you can say print to it.

having a print button is the way to do it (that button that triggers a method with controller.print())