Property: default

How can I change the default settings for a property that is not controlled by Style?

That depends on what the property is for. Is it a form or an element or what? In any event, look in the editor and locate the item. If it is a field or button, etc, you’ll need to give it a name so it shows up in the editor tree. Once you find the item of interest, just look at the available properties. Assuming the property you wish to control is available, you can then simple set it using a method that is triggered when the form is loaded, when the record is selected or on most any other time you’d lake the property set.

But there is any way to change Default settings, to apply when the object is being created?
There is some place where those settings are stored and modified?

By example, how to have the property onFocusGained or onFocusLost setted to a defined method at the creation of the field without setting it every time?

lcr159:
But there is any way to change Default settings, to apply when the object is being created?
There is some place where those settings are stored and modified?

The only defaults are in Designer under the Edit/preferences menu, but these are limited. You also get what you get with LAF and Styles.

I agree that for other stuff, it would be helpful to have more preferences/defauls settings. I always seem to be doing stuff like making fields longer or renaming primary keys from the defauly ‘keyid’ to ‘key_id’ so I can read them.

I confess I’m puzzled about default property settings as well.

I’m currently using the “out of the box” properties and manually changing them all as needed, chiefly because how to change them hasn’t been obvious. I asked (long ago), was told it’s simple, has something to do with style sheets. Since the answer was cryptic and incomplete I’ve been manually changing settings inefficiently ever since.

It would be helpful if there were a good tutorial on how to reset the default properties.

Hi All,

Short answer: There is no way currently to set the “default” options of newly created objects.

Longer answer: You CAN create an object, set its properties and then copy/paste that object to retain the set properties. The best way to set physical properties of an object is to use a style (to control the appearance). BUT, there’s no way to set the “default” style a type of object is supposed to use. It’s very easy to set the properties of all of a certain type of object: select one of the type of objects you want to set the properties for (i.e. a field) and then press ctrl-A (for select all).

I agree it would be handy to be able to control these default properties.

With Servoy 5+ you can also create “Templates” with all your preferred UI properties. Simply select an object (or objects) on the form editor set its (their) properties, then right click and select “Save as template…”, you will be asked for a name. From then on, each time you want to creqate a new object based on these properties, click on the “Resources > Templates”, you will find a list of your templates under the solutionExplorer, just drag and drop to the form editor!

I was wondering how to use templates, that’s just what I’m looking for, thanks