|
4.6 Dataview Fields Representing Screen Data The layout of a page is determined by its template and style, but most pages have an area in the centre which is used to display and input data. These data items, their format and their order is defined by the dataview structures linked to the page. Most page styles accept a single dataview type set using the "dataview" property on the page. Some page styles also accept a masterDataView property, in this may add to the layout. The effect of style and templates on layout are dealt with elsewhere, as is the effect of related dataviews. This how to discusses the general properties of the dataview fields that influence their layout on the page.
By default each dataview is laid out in order and each field is laid out within its dataview in order. The default order of the fields within the main dataview of a general page is the order they are defined on the attribute tab of the properties view of the dataview. In the case of fields defined by an asterisk, they follow the order defined in the attribute list of the initial entity. The property screenPosition can be used to order the fields and related dataviews, with all those for which screen position has not been set displayed first. Screen positions should always be positive integers. If a field has an access style of "hidden", it won't appear on the page. The first thing that determines the look of a field on the screen is the type of data. Strings and numerics default to a text box, booleans to a checkbox and Dates to a day/month/year split combination, where day and month are dropdowns and the year is a four digit free text. Most fields appear with a label to the left hand side. The label is the fieldname by default, but the externalName of the field, if set, will override that. If you set the labelStyle to nolabel, the label will not appear. The accessStyle of "readonly" prohibits data entry by keying in (but it could still be filled in as say a lookup or by calculation). If the required field is set to "true" the label changes colour to indicate that the field must be filled in during data entry. The next thing is the displayStyle. Separate pieces of display code, called controls, have been written to allow variety of display and it is envisaged that more will become available in future releases. These controls are accessed depending on the displayStyle, and a style of textbox, might be used to make a boolean or Date to appear in a similar way to a String or number. displayStyle "dmy" can be used to make a date appear as a dd/mm/yyyy three dropdown Date, defaulting to the system date at runtime. Strings can be displayed in multi-line text areas, using the displayStyle "textarea", or as boilerplate readonly text using the displayStyle "text". Some controls support a second property, format, which enhances the use of individual displayStyles. The format string consists of a list of instructions to the control, each prefaced by an @. A textbox date's input format is @i, output format @o, eg @oEEE, MMM d, yy. This facility can be used to make a date field act like a time field. @h8 would give 8 lines height to a textarea, and @html allows "text" Strings to be displayed using many of the display features available in html, eg @htmlstyle='color:blue;font:italic large' or access to css using the format instruction @htmlclass=. The display in a general page and a search page might be different. This is because the format of a date might constrained when entering a value, but you might want to search for a range of values, eg Between 01/01/2005 and 10/05/2005, or not limiting a search on a Boolean field to true or false (null values being unavailable from a checkbox). All controls currently provide textboxes for searching. Full information on available styles and formats can be found in the section "How to put on the style." Links:
Copyright © 2001-2006 New Technology / enterprise Ltd. | |||||||||||||||||||||