Javascript and FPL

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

rippertoews
Ebase User
Posts: 2
Joined: Tue Jan 27, 2015 4:53 pm

Javascript and FPL

#1

Postby rippertoews » Wed Jan 28, 2015 12:36 pm

Hi everyone,

I'm new to Ebase and have a question regarding the scripting language... do most experienced Ebase dev's use Javascript more than FPL... or is there a time when you want to use both - I'm asking because I'd like to develop good habits starting off and I'd like to know if there is an advantage to using both.

Thanks,
Jason
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#2

Postby alexmcclune » Wed Jan 28, 2015 12:43 pm

We use Javascript...take a look at this thread from a while back.

http://forum.ebasetech.com/forum/viewto ... javascript

The ebase guys, moderators, have given some good answers
0 x

rippertoews
Ebase User
Posts: 2
Joined: Tue Jan 27, 2015 4:53 pm

Javascript and FPL

#3

Postby rippertoews » Wed Jan 28, 2015 12:52 pm

Perfect... Thanks for the quick response!

alexmcclune wrote:We use Javascript...take a look at this thread from a while back.

http://forum.ebasetech.com/forum/viewto ... javascript

The Ebase guys, moderators, have given some good answers
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#4

Postby Segi » Wed Jan 28, 2015 3:03 pm

I have been using eBase for a while now and would definitely recommend JavaScript. It is much much more powerful than FPL.
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#5

Postby alexmcclune » Fri Feb 06, 2015 8:15 am

Following on the best practice sort of talk we have had in this thread and another I would like to explain how I built a form and I wondered if you guys thought it was good/bad practice.

Basically I found that for each form we developed we required a whole heap of scripts as we handled events on the various controls etc. I found this a bit hectic even when using a sensible naming convention within ebase. Our solution has been to create a number of global scripts to handle the some of the generic functionality followed by creating only two scripts per form.

One script that sets up parameters for the form.

One script that includes all of our functions for handling events on the controls within the form. These functions are then called via jquery as the script is then set as "client callable" and "shared" depending on how the functions are called.

Is there anything I should consider in creating the forms this way? Specifically security vulnerabilities...

Thanks
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#6

Postby Jon » Fri Feb 06, 2015 12:15 pm

Technically, this approach makes the application more vulnerable to attack. This is because all the functions declared as "client callable" are now exposed to the browser.

If the concern is that you accumulate a large number of server scripts, an alternative approach might be to have just one script to handle all button clicks, immediate validations, hyperlink clicks, image clicks etc - in fact everything that comes from a control. And then in the script check what has been clicked, then call the appropriate function. Something like this:

Code: Select all

var owner = event.owner.elementName;
switch (owner)
{
  case "BUTTON1": 
       function1();
       break:
  case "BUTTON2:
       function2();
       break;
  etc..
}
You could also use this technique with before page events.
0 x


Who is online

Users browsing this forum: No registered users and 18 guests