[Tutorial] Forms, Elements and Methods Overview
by Marcel Trapman
www.it2be.com
Marcel
www.it2be.com
Ok, here you are, you are developing your very first Servoy (test) application and you get stuck because of those tiny little things you don't know of.
With this little article I take a shot at helping you to understand some things about forms, elements and methods. Not a complete tutorial and not a complete reference at all. My only goal here is to help you developing your solutions with Servoy.
Forms:- are the basis for your solutions window
- are based on one table of your database(s)
- can contain all kinds of elements
- can contain methods
- titleText: can be used to set the title of a window, combined with tags %%tag%% and i18n very powerfull
- onXXX: these properties can be set to attach a method to the named event or 'menu' choice. In case you attach a method to a 'menu' choice you replace the 'standard' functionality with your custom functionality
- view: there are 3 possible views, record-, list- and table-view. The first two can be viewed in normal mode, giving the user the possibility to switch between views. Little downside of these views is a 'margin' on the left, needed to show the location of the record in the table. However, when you lock the view, user-switching of the view is not possible anymore and the 'margins' are gone.
- a reference to a form could look like forms.formname
- in some environments known as objects
- field elements can be chosen when creating a new form
- all elements can be chosen from the menu and placed everywhere on the form
- fields can be changed into comboboxes, htmlfields etc (holding a reference to the dataprovider (column/field) of the table of the form or a related dataprovider) via the displayType property
- the tab sequence of elements can be set via the tabSeq property
- can be labels, graphical elements, beans etc.
- the name property: by setting the name property of an element you are able to individually set the properties of the element via a method
- element properties and functions can be set/called from within a form like 'elements.elementname.property' or from other forms or global methods in the following manner: 'forms.formname.elements.elementname.property' (there are more dynamic methods but again these go beyond the scope of this article)
- readOnly: elements can, individually, be set to be 'read only'. However there is also a form/controller property named controller.readOnly. By using this property you set all elements that have the readOnly property. Please bare in mind that by using this controller property you also set this property for possible tabpanels/forms on the form you call the controller from
- enabled: see the above
- aka scripts or maybe classes
- contain code (javascript) that has to be executed
- can be global, attached to (events of a) form or attached to (events of) elements
Marcel
Comments (1)