PDA

View Full Version : JS delegates callling VFP server side functions



SpringBox
2019-09-10, 12:56
Hi Guys

We are just getting to grips with using JS to call VFP servr side functions and got it to work in desktop preview mode but in Android tablet view mode it didnt work

We are using :

var result = Lianja.evaluate("serverside()");


Is the syntax different if calling from a mobile device?

Thanks in advance?

Simon

SpringBox
2019-09-10, 13:15
Also - is there a reason why canvas sections and image gadgets do not show up on tablet preview or web preview but do on desktop preview?

Thanks

SpringBox
2019-09-10, 13:42
Hi Guys

Is Phonegap still available from anywhere so we can test our forthcoming iPad app? Should we test it on Android instead?

Cheers

Simon

barrymavin
2019-09-10, 14:18
Hi Simon,

No there's no difference. If you have deployed your server side code you can call it from any client; desktop, web and mobile.

its better to ask one question in each post so they can be answered individually.

barrymavin
2019-09-10, 14:19
Also - is there a reason why canvas sections and image gadgets do not show up on tablet preview or web preview but do on desktop preview?

Thanks

No they should do if you have checked the presentation rules for them.

barrymavin
2019-09-10, 14:24
Hi Guys

Is Phonegap still available from anywhere so we can test our forthcoming iPad app? Should we test it on Android instead?

Cheers

Simon

Apple took the Adobe Phonegap developer app out of the App Store a while back. Details on how to install it can be found on the phonegap site.

http://docs.phonegap.com/references/developer-app/install/ios/

It may be easier to test on an android device.

Many desktop web browsers (chrome for example) have the ability in the developer tools to switch to various emulation and geometry views such as phone or tablet also.

barrymavin
2019-09-10, 14:29
Hi Guys

We are just getting to grips with using JS to call VFP servr side functions and got it to work in desktop preview mode but in Android tablet view mode it didnt work

We are using :

var result = Lianja.evaluate("serverside()");


Is the syntax different if calling from a mobile device?

Thanks in advance?

Simon

Make sure your server proc is not reliant on the data session in desktop. In other words it should be stateless and not assume a database and tables are open. That's a common mistake made. Use push/pop datasession.

Run the app in a browser and from the JavaScript condole yiu can test your Lianja.evaluate() calls interactively.

SpringBox
2019-09-10, 14:58
Thanks Barry

Understood about the stateless nature of the mobile UI.

So far these calls just flash up a messagebox so there is no data reliance yet.

Any thoughts?

Simon

SpringBox
2019-09-10, 15:01
Yes sorry - one question per thread from now on.

Will try to keep the idiot questions to a minimum.

Thanks

Simon

barrymavin
2019-09-10, 15:04
Thanks Barry

Understood about the stateless nature of the mobile UI.

So far these calls just flash up a messagebox so there is no data reliance yet.

Any thoughts?

Simon

You cannot "flash up a message box" on the server. You can't use any UI commands in server code.

SpringBox
2019-09-10, 15:13
Hi Barry

Form sections are fine but none of the canvas sections appear on any of the pages in any preview other than desktop (only used because we wanted a command button and cannot get the Dialog button to appear on a form textbox).

All presentation rules are ticked.

Any thoughts?

Simon

barrymavin
2019-09-10, 15:42
Hi Barry

Form sections are fine but none of the canvas sections appear on any of the pages in any preview other than desktop (only used because we wanted a command button and cannot get the Dialog button to appear on a form textbox).

All presentation rules are ticked.

Any thoughts?

Simon

Canvas sections are supported in all clients. Look in the JavaScript console of the browser. It should show you any errors.

barrymavin
2019-09-10, 15:46
Canvas sections must have their scripting language set to JavaScript for web/mobile apps otherwise they won't be included in the generated code. VFP doesn't run in the browser client.

SpringBox
2019-09-10, 17:37
Hi Barry

Even when changed scripting language of canvas sections from inherited to JS, still cannot get them to work so removed them for now.

Will try some again tomorrow.

Cheers

Simon

barrymavin
2019-09-10, 17:47
Try them in web app view. If they work there they will work on mobile devices. There's example mobile apps you can look at to study.