Page 1 of 1

Option for creation of lean function code

PostPosted: Wed Sep 28, 2016 3:26 pm
by Bernd.N
I have created a JIRA ticket for this and would like to get voters on it, as this is something I would really be happy about:

When adding functions to a form, e.g. the onAction function for a button or the onDataChange function for a field, Servoy adds comments like this:
/**
* Perform the element default action.
* @param {JSEvent} event the event that triggered the action
* @private
* @properties= {typeid:24,uuid:"7C90D813-17BA-43F7-8457-C204FAB9F1A9"}
*/
function onAction(event) {
// TODO Auto-generated method stub
}

As I like my code to be without any noise, I currently take out all those red comments for each new function, which is quite a bit of work when writing a lot of functions.

Therefore, an option to let Servoy create such functions without such comments would be great.
The ticket is here: https://support.servoy.com/browse/SVY-10410

Re: Option for creation of lean function code

PostPosted: Mon Oct 03, 2016 10:29 pm
by goldcougar
I think that option exists already. If you create your method first, then you can define it however you want. Open up the .js file, type:
Code: Select all
function myfunction(myparam){
}


Then click save. Servoy generates a much more basic JSDoc. Then assign that function to your action/event.

Templates

PostPosted: Tue Oct 04, 2016 10:41 am
by Bernd.N
The advantage of the creation from inside the form is that the object is directly hooked to the function that you create.
But you are right, I should code first in the js, using the powerful template function of Eclipse to build my own snippets and then hook the function to the form or field.

template.png
template.png (78.19 KiB) Viewed 1752 times