Extends field properties

Questions and answers for designing and implementing forms in Servoy

Extends field properties

Postby DEK4 » Fri May 18, 2012 11:28 am

Hello,
is there any possibility to extend filed properties with other personal?
User avatar
DEK4
 
Posts: 111
Joined: Wed Oct 12, 2011 9:26 am

Re: Extends field properties

Postby omar » Wed Jun 27, 2012 4:31 pm

Hi, I don't know if your still looking for an answer but it took a while to decipher 'filed properties' (field properties) :D

To use custom properties for text fields:

1. In the form designer select the field you want to extend
2. In the property sheet look for the deisgnTimeProperties property
3. Fill in the name of your custom property (ie personal) in the textbox and press the add button
4. Give the new property a default value

At runtime you can get it's value like this:

Code: Select all
elements.myTextField.getDesignTimeProperty('personal');


In the same way you can use putDesignTimeProperty for setting values at runtime and removeDesignTimeProperty for removing them.
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: Extends field properties

Postby DEK4 » Thu Jun 28, 2012 5:12 pm

Hi! Thanks for your answer :)

i tried with Servoy 6.0.6 but i don't find this properties...i need to download the 6.1?
User avatar
DEK4
 
Posts: 111
Joined: Wed Oct 12, 2011 9:26 am

Re: Extends field properties

Postby omar » Fri Jun 29, 2012 10:09 am

Sorry, yes indeed. The final version will probably come out today or tomorrow.
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: Extends field properties

Postby DEK4 » Fri Jun 29, 2012 12:28 pm

Ok thanks a lot! =)
User avatar
DEK4
 
Posts: 111
Joined: Wed Oct 12, 2011 9:26 am

Re: Extends field properties

Postby ROCLASI » Tue Jul 03, 2012 8:43 am

omar wrote:Sorry, yes indeed. The final version will probably come out today or tomorrow.

They tagged the 6.1.0 final yesterday (https://www.servoyforge.net/projects/se ... sions/7257) in SVN so I think it will be released somewhere this week.
Probably friday or saterday.
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: Extends field properties

Postby DEK4 » Thu Jul 12, 2012 9:15 pm

thanks for your answer...i don't understand how can i use this function..

if i want to create a new property called for example "test" and i want that this property contains a method can i do it?
User avatar
DEK4
 
Posts: 111
Joined: Wed Oct 12, 2011 9:26 am

Re: Extends field properties

Postby omar » Fri Jul 13, 2012 9:44 am

No, that's not the way to go. In a property you can store values or strings. If you want to add a method on the fly at runtime use the solutionMode like this:

Code: Select all
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600);
var method = form.newMethod('function aMethod(event){application.output("Hello world!");}');
var button = myListViewForm.newButton('Show message!',50,50,100,30,method);
forms['newForm1'].controller.show();
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: Extends field properties

Postby DEK4 » Thu Aug 23, 2012 5:37 pm

It works! Thanks! :D
User avatar
DEK4
 
Posts: 111
Joined: Wed Oct 12, 2011 9:26 am


Return to Forms

Who is online

Users browsing this forum: No registered users and 9 guests