Special web client code

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

Special web client code

Postby JonathonBevan1342106235 » Fri Aug 03, 2012 9:06 pm

I was on the understanding that there wouldn't be any special code to make the same application run on your computer and when running on the web.

But looking at the CRM example I find code like this...

if(application.getApplicationType() == 5)
{
/** @type Number*/
var idx = elements.tabs_mainPanel.tabIndex;
var frm = elements.tabs_mainPanel.getTabFormNameAt(idx)
forms[frm].controller.enabled = false
forms[frm].controller.readOnly = true
}

Please could you tell me why you would need such special code as I don't understand why.

Thanks in advance.

Jonathon
JonathonBevan1342106235
 
Posts: 46
Joined: Thu Jul 12, 2012 5:17 pm

Re: Special web client code

Postby ROCLASI » Fri Aug 03, 2012 9:20 pm

Hi Jonathon,

That piece of code doesn't do anything special other than disabling the form and setting the form to read-only.
So this has nothing to do with making the solution functional on the web or not but more with a business-rule to not allowing any buttons to work and data being editable when using applicationType 5.

Having said that there are always some functions that are smart-client only for the simple fact that they are not available/accessible in a web-browser. Also not all beans are web-enabled and therefor are not usable in the web-client.
So yes, Servoy does allow you to use one single codebase to deploy to both smart- and web-client. But there are always (third-party) extensions or functions that are not compatible with one or the other.

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

Re: Special web client code

Postby JonathonBevan1342106235 » Sat Aug 04, 2012 1:12 pm

Thank you very much. I needed that explanation. From what you say I will probably know when special code is required and that is reassuring...

Thanks again.
Jonathon
JonathonBevan1342106235
 
Posts: 46
Joined: Thu Jul 12, 2012 5:17 pm


Return to Web Development

Who is online

Users browsing this forum: No registered users and 5 guests