adding objects programmatically

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

adding objects programmatically

Postby Boudewijn » Sun Feb 13, 2011 11:22 am

it would be nice if I could add objects programmatically.
The basic idea is this:
I create a textbox, create some custom properties in that and save that in a library:
on a form I can then code something like:
forms['thisform'].Newobject("ObjectName","Library","libraryObject",[param1], [param2], [paramnn])
assuming ObjectName would be "mytextbox" I could then later on do something like
forms['thisform'].mytextbox.top = 123
forms['thisform'].mytextbox.left = 456
forms['thisform'].mytextbox.text = "Just created textbox"
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: adding objects programmatically

Postby ROCLASI » Sun Feb 13, 2011 12:24 pm

Hi Boudewijn,

You already can :)
Take a look at the SolutionModel node in the Solution Explorer.

Hope this helps.
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: adding objects programmatically

Postby Boudewijn » Sun Feb 13, 2011 11:57 pm

Are you saying I can create base classes of any object type (textbox, label, combos, lists, buttons etc etc) and use those in my forms?
Because THAT is what I am talking about here.
OOP as OOP is meant to be.
If that is really true then I wonder why this waas not shown in the training I did in september last year.
BY ALL MEANS! Show me how to achieve that.

Next URGENT Q is, "is there something like field mapping?", this is, Field type mapped to a specific class in a library! THAT would be fantastic!

Boudewijn "spoiled rotten" VFP developer.
Boudewijn
 
Posts: 41
Joined: Sun Sep 26, 2010 8:35 am

Re: adding objects programmatically

Postby jcompagner » Mon Feb 14, 2011 11:32 am

what you want can't be done by servoy base classes, Servoy just provides you some base classes, you can't subclass those as real classes, for that we have our templates, where you can pre configure or combine components that you then can reuse on forms.

If you really want to do more you have to work with beans.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 11 guests