Option for creation of lean function code

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Option for creation of lean function code

Postby Bernd.N » Wed Sep 28, 2016 3:26 pm

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
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 474
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: Option for creation of lean function code

Postby goldcougar » Mon Oct 03, 2016 10:29 pm

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.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 657
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Templates

Postby Bernd.N » Tue Oct 04, 2016 10:41 am

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 662 times
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 474
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 3 guests

cron