application.getApplicationType() for web client

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

application.getApplicationType() for web client

Postby huber » Mon Jul 22, 2013 2:49 pm

Hi Servoy Web Developers

I use following code to get the appropriate style sheet loaded, but if I start the browser, the _7rWeb style is not taken. The code is on the onOpen() method of the main module (property normal). Any idea?

Code: Select all
   if (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT) {
      application.overrideStyle('_7rMac', '_7rWeb');
      ...
   }
   else if (application.getApplicationType() == APPLICATION_TYPES.SMART_CLIENT) {   
      ...
   }


Best regards, Robert

Servoy 5.2.16
OS X 10.8.4
Java 1.6.0_51
Safari 6.0.5
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm

Re: application.getApplicationType() for web client

Postby ngervasi » Mon Jul 22, 2013 3:29 pm

That should work, make sure that you didn't use that style in the login form, that could prevent the override if I remember correctly.
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: application.getApplicationType() for web client

Postby huber » Mon Jul 22, 2013 4:01 pm

Hi Nicola

I have the _7rMac (style) set for the Login form property styleName. I changed it for a test to Default, but it still doesn't work.
I am not sure which style you mean shouldn't be used on the Login form?

Robert

ngervasi wrote:That should work, make sure that you didn't use that style in the login form, that could prevent the override if I remember correctly.
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm

Re: application.getApplicationType() for web client

Postby ngervasi » Tue Jul 23, 2013 11:33 am

Try to use a different style on the login form, I think that if I style has already been "touched" it cannot be switched.
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: application.getApplicationType() for web client

Postby huber » Tue Jul 23, 2013 12:21 pm

Used another style than _7rMac on the Login form, but still the same result, i. e. does not use the desired _7rWeb style(sheet). I also can't debug, as the debugger does not stop on a breakpoint with the Web Client. It does stop on breakpoints when using the Smart Client.
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm

Re: application.getApplicationType() for web client

Postby ngervasi » Tue Jul 23, 2013 1:08 pm

Hmm, then I don't know what's happening, it works fine for me but I create the style on the fly like this:
Code: Select all
if(globals.gui_settings.style_name)
      {
         solutionModel.newStyle(globals.gui_settings.style_name, globals.gui_settings.style_code)
         // Override the default style
         application.overrideStyle('sintpro2008',globals.gui_settings.style_name)
         application.output('Using style: '+ globals.gui_settings.style_name,LOGGINGLEVEL.DEBUG)
      } else application.output('Using default framework style')
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: application.getApplicationType() for web client

Postby huber » Tue Jul 23, 2013 3:22 pm

Thanks Nicola, I hope someone using the "static" code jumps in to say if it works.
BTW, can you debug a web client setting breakpoints and the debugger stops at them?
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm

Re: application.getApplicationType() for web client

Postby ngervasi » Tue Jul 23, 2013 3:29 pm

Yes, it works fine for me
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: application.getApplicationType() for web client

Postby huber » Tue Jul 23, 2013 3:36 pm

What Servoy Developer version are you using? Can you also debug when the Servoy application server is on a server or only local on the same machine?

ngervasi wrote:Yes, it works fine for me
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm

Re: application.getApplicationType() for web client

Postby ngervasi » Tue Jul 23, 2013 4:06 pm

Robert, you can only debug when starting the clients (web or smart) trough Servoy Developer. No matter the version.
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: application.getApplicationType() for web client

Postby huber » Tue Jul 23, 2013 4:47 pm

I start the web client from Servoy Developer, but wherever I set a breakpoint, the debugger does not stop. No idea what the problem could be. I also do not get any application.output() message displayed in the Eclipse Console (tab). Hmmm.

ngervasi wrote:Robert, you can only debug when starting the clients (web or smart) trough Servoy Developer. No matter the version.
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm

Re: application.getApplicationType() for web client

Postby ngervasi » Tue Jul 23, 2013 4:55 pm

That happens sometimes on mac after developer has been running for a while. Restart developer and as the first thing start a smart client, dunno why but that helps a lot.
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: application.getApplicationType() for web client

Postby huber » Wed Jul 24, 2013 1:02 pm

I found the reason why the debugger did not work. I am starting via the launchctl mechanism the application server (java process). This is not a problem for the Smart Client debugger, but the debugger does not work under this circumstances in the Web Client. May be there is a technical reason for that (Servoy?).
The application.overrideStyle() problem is also solved. The command was not executed, as the method got quit before that statement because of a plugin.dialog error.
Thanks for all the suggestions which led me at last to try what was the problem, i. e. deactivating the automatic startup of the application server.

ngervasi wrote:That happens sometimes on mac after developer has been running for a while. Restart developer and as the first thing start a smart client, dunno why but that helps a lot.
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 317
Joined: Mon May 14, 2012 11:31 pm


Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest