You are here: >Help Web>DesigningTheGUI>OtherFields (09 Dec 2012)

Fields

barcodeicon.png Barcode Field

The Barcode field is a shortcut to add a Text field with a default click action to perform a ReadBarCode action. A context menu item is also added. This allows scanning of a bar code using the device's built-in camera. A device with an auto-focus camera is required. Some Windows Mobile devices that include a built-in laser barcode scanner are also supported.

See BarCodeReader integrations.

Button Field

Button fields can include icons and text, with various layout options for both icon and text.

CheckBox.PNG Checkbox Field

CheckBox field indicates whether a particular condition is met or not met. Its coresponding database value sets is configurable in the Lookup section of Checkbox property. For example, database has a score column which contains two possible values: fail or pass. In the checkbox field, Checked Value can be set as "fail" and UnChecked Value can be set as "pass".

dateicon.png timeicon.png Date, Time Fields

These fields use the built-in functions of the device to allow the uesr to enter dates and times. Date, Time and DateTime values received from a database are assumed to be in GMT and are converted by the device using its configured timezone (see Timezone Conversion). A null timefield will show empty in the field, and a time of 00.00 (GMT) will show as 19.00 on a device in the EST timezone.

The default value of Date field and the Time field is null; however, you can set initial value of data or time field as NOW which will display the current date or time on the device as default value when the form loads. If the date or time field is linked to database, the initial value of field will be overriden by the corresponding database value. If user wants to override the database value, an OnLoad action or a script action will be required to set the value. The Onload action occurs after database values have been set; while database value loads after the initial values have been set.

The date, datetime, or time value is stored as a long value after conversion to UTC timezone (see Timezone Conversion), using the Java date format, which is an offset from Jan 1st 1970 in milliseconds.

Moreover, you can also set the format string of date fields to whatever you like according to Java's standard, like: HH:MM:SS - see details in the Appendix.

Timezone Conversion

Datetime and Time fields are converted from UTC to the mobile device's local timezone when displayed. There is no conversion for Date fields. Date fields are always in UTC.

When Datetime and Time values are entered on the device, they are entered using the device's local timezone, and then converted to UTC before storing. Date fields are entered and stored using UTC.

Date fields always use UTC to prevent rollover when a device's local time is near a day boundary. For example, if a user enters a date value of 'Jan 1, 2010' and performs this data entry at 23:00 EST (-05:00), the conversion to UTC would result in the date being stored as 'Jan 2, 2010', which of course, is not desired. If timezone is to be considered, use the Datetime field type, rather than Date field type.

emailicon.png Email field

The email field provides a default Click menu action to open a Compose email message window to send an email to that address.

gpsicon.png GPS Location Field

The GPS field can store a location, show the location on a map, and get the current position from the GPS device. The maps are shown using Blackberry maps. (Google or other browser based mapping is also possible with Lua scripting, examples are available) .DragonRAD Designer has built-in features that allow you to acquire the current location (using the built-in GPS), and show the Location in a map. The location is stored as a string in lat, long format, e.g. ” -45.123456, -10.456789”

The GPS field provides default menus for these functions as described below but they can be configured as required.

For example: To view the current location using the default menus on a GPS field, press the Context Menu Button and then press Acquire Location. If a location is found, the field will have the text 'Location'. The location can be viewed in a map by clicking the trackball or by selecting Show Location from the Context Menu. Look below to see an example. look in section

The GPS field can be set to automatically load the current GPS position and can show a map when clicked.

Note: the BlackBerry MDS must be running for the maps in the Blackberry Maps integration to show in the simulator.

To automaticallty load the current position of the device when a form is loaded, use the value 'HERE' as the initial value.

See also GPS Integrations

gpslocation1.png gpslocation2.png gpslocation3.png

htmlicon.png HTML field

This field embeds a web page into a form similar to note fields, but are non-editable, and they provide html formatting capability to the extent available in the device's browser. Html content can come from the internet using a URL, or supplied directly from the database. In BlackBerrySimulatorInstall, the Page Down shortcut key is also supported. Script can be embedded in the html to provide custom content related to the application and to provide custom click actions that integrate with the DragonRAD environment.

imageicon.png Image Field

Image fields will show either a static image defined at design time and embedded in the project file, or a dynamic image loaded from a Datatable. Images created from the camera are stored in JPG format. The image field can display JPG and PNG files. The resolution is defined by the camera settings on the device, except in Android where this code can be used in Lua: local myField = clientevent.form.fields["imageField"] myField.setImageCaptureSize(800, 600) The image will be resized to fit the field under these rules:

  • If the field height and width are not set:

the actual image size will be used, up to the width and height of the display screen.
  • If the image is narrower than the screen, the image will be displayed full size.

  • If the image is wider than the screen, it will be resized to fit the width, and the field height adjusted accordingly

  • If the field is set to a specific width in DragonRAD Designer:

The image will be displayed using the width requested
  • If the field is set to a specific height in DragonRAD Designer:

The image will be displayed using the height requested
Default Menus for the Image field:
  • Click menu: Select will open the image for viewing with pan/zoom modes.

  • Context menu: Select

If the field is updateable (not read-only),
  • <;">Camera to start camera app;

  • Browse for image;

  • Select most recent image.

Menus can be configured using the DragonRAD Designer menu editor.

If a record size is too big , it may not be inserted into a database. Log file will show error message for the situation. The max_allowed_packet of the database should be reset then.

integericon.png realicon.png Integer, Real Fields

Integer and Real fields provide an additional property, Increment, which specifies how much to add or subtract from the value by default when selecting the field and scrolling.

The Format String property of Integer and Real fields can be used to format the field according to Java's standard, (e.g. ###.00)

LabelField.PNG Label Field

Sets or returns a value (the name or data field value) that identifies the field to use as a lable.

listicon.png List field

List fields contain a text entry that can be selected from a list of available fields and can associate a coded entry with a full text string for display. For example, the user might select 'COMPLETE' which would store the value '0' as the value to be stored in the TableRow. Either a predefined lookuplist can be used as a source of data for list fields or a Datatable optionally filtered by a constraint..

Preset lookup lists

In the Designer, you can create the available list of values for a specific field directly on a screen, without using a database table. This would be the preferred method for a static list that never changes.

Online Search

See description below. Data is looked up using a query form and a http server-based query.

Lookup from a Datatable

If the list of values may change or is dependent on another field value, it is best to create a database table to store the list of values (a coded data field and an optional display or value field. A main table can be used to store this list data. For example, a Status Code might have three values, 0, 1 and 2; corresponding to “pending”, “sent” and “complete”, as shown below. These would be contained in a table LookupValues as below:

  • Table LookupValues:

    StatusCode

    StatusValue

    0

    pending

    1

    sent

    2

    complete

The data in the Datatable could be retrieved directly form a table on the server, or created dynamically using sql to return data structured as a table. In the example above, the list box, the LookupTable property for the list field would be 'LookupValues', the DisplayField would be the field LookupValues.StatusValue, and the ValueField would be LookupValues.StatusCode.

The data field is the data that is actually stored in the database field that the lookup table is linked to.

The Datatable can be populated either with a normal query to a table on the server, or from a list generated from other data using a SQL query to create a list of items – for instance if you have a field and you want to show all the options currently in use, you can create a SQL lookup table using

“SELECT DISTINCT field from mytable;”.

List Selection Modes

There are 4 types of selection field that can be provided to the user to allow selection of the required item:

  • Drop-down list, Editable Drop-down

In this case, when the field is clicked, a vertical scrollable list will popup showing the items.
  • Search screen

In this case, when the field is clicked, a panel will show containing the items in a table. The table can be filtered by the initial characters by typing into the search box which will reduce the items to display until the required item can easily be found. Clicking the desired item will close the search panel and load the selection into the list box.
  • Online Search

This method is appropriate where a large amount of data is required and it is not desirable or practical to download the data to the device. An html field is used to allow the user to enter search criteria which is then sent to a server. The result is then loaded to the list box.
Cascading Lists / Constraints

Cascading lists allow a selection in a list to modify the available selections in another list. For example, you have may have a table containing a list of buildings, and another containing the floors within that building, and another containing the rooms on each floor, each of these would be linked to a list box on a form. The method of operation would be for the user to select a building, this would run a constraint on the floors list, to show only the floors in the selected building. Once the floor was selected, then the rooms list would show only the rooms on that floor.

To achieve this, constraints must be set up between each list. The floors list would use the 'floors' table as it's lookup table. This table would specify a floor id, a floor description and a building id for each floor. The constraint would identify the 'buildings' list field as the source data for the constraint (i.e. the selected building id), and the matching field in the lookuptable for the floors list would be 'building id' in the lookuptable for the floors list, i.e floors.building_id. In this way, the floors list field can read the selected building id and select only the floors in its lookup table (floors) that match this building id.

See the ListConstraints? chapter in the Appendix.

Allow Empty/Empty List Selection String

If the Allow Empty attribute is set to True, then a blank value will be displayed on new records, and on records where the saved value is null.

If the Allow Empty attribute is set to True and the Empty List Selection String is not blank, then the Empty List Selection String is displayed as the default value on new records and on records where the saved list value is null.

An example of the Empty List Selection String is: "--- Select ---", which would help the user realize that a value must be selected.

FieldValidation can be used in conjunction with this feature to validate user entry.

On the Android platform, there is a hard limit on how much memory each application can use. To reduce this and to improve performance on large lookup tables, see Table Performance

mediaicon.png Media field

Please note: Media field has been separated into Audio field and Video field since version 4.1 and later

The Media field has built-in actions and dialogs for recording and playing voice and other sound files.

  • Default Click Menu:

  • Play (if data is present for the field), or Record (if no data and not read only), or a menu of both options otherwise.

  • Default Context Menu

  • Play (if data is present for the field)

  • Record (if not a read-only field)

  • Media fields in Blackberry record audio in AMR format. A variety of converters are available to convert from AMR to more familiar formats such as mpg and wav.

Note: Your machine must have a sound card for the simulator to work correctly when testing the Media field

Play dialog:

mediaplayer1.jpg

Record Dialog:

mediaplayer2.jpg

If a record size is too big , it may not be inserted into a database. Log file will show error message for the situation. The max_allowed_packet of the database should be reset then.

NoteField.PNG Note field

When the text contents might be bigger, note field can be used. Lines property of Note field is configured for maximum lines that can be shown on the screen. This property is used to calculate the height of note field.

horizpanelicon.pngheadericon.pngfootericon.png Panel fields

Panels are used to organize fields horizontally. There are three types of panels:

horizpanelicon.png HorizPanel

headericon.png Header

footericon.png Footer

Headers and Footers are fixed to the top (header) and bottom (footer) of the form even if a scroll bar is required to scroll other items into view.

HorizPanels, unlike Headers and Footers, a can be placed anywhere in the main section of the form.

Panels are divided into three areas: left, center, and right. Field can be added to a panel and allocated to one of these areas. Panels will default their height to the size of the field it occupies; however, if it is desired, the height can be manually adjusted in the Properties menu. If a field is placed into a panel with an existing field and they share the same position (left, center, or right), then the field is stacked beside the other field. A empty panel is ideal for a spacer between fields. Below, is a screen shot of some panels.

Header / Footer / Horiz Panel Layout

headerfooterlayout.png

phoneicon.png Phone field

A Phone field shows a formatted phone number and provides a default Click menu action to dial the number.

SeperatorField.PNG Separator Field

Separator field is normally used in form design to help visually orgainze your form layout by grouping similar fields together.

SignatureField.PNG Signature Field

Signature field is provided to integrated with touch screen device or external Grabba device for capturing a user's signature in the field and submitting to a database. Signature capture on Android is not included, but is available. Please contact us for details.

SubtitleField.PNG Subtitle Field

Subtitile field is mainly used for describing each individual tabs. Form can contain multiple tabs. Each Tab can have its own subtitle field.

TextBoxField.PNG Textbox Field

The Textbox field is typically used by the user to enter some text into the application or form. More commonly used to enter small text data. Note field should b used with multiline feature for longer text inputs. You can also use textbox field as password field by changing its type.

Video.PNG Video field

Video field has been provided to view streamed video. Please note, video field is supported on Blackberry device only.

The Video field has built-in actions and dialogs for recording and playing video files. Supported formats depend on the device. Detail can be found at BlackBerry's support site

Video source can be set throught its initial value, or via database, and video source must be an http url (for static source), or rtsp url (for live stream)

Default Menu Items will be automatically added to the video field when video field is created. They are:

  • Video Start
  • Video Stop
  • Video Pause

Comments:

Note, please check the forum if you have questions or email support@dragonrad.com

Please Log In to add a comment

 

Topic revision: r27 - 09 Dec 2012 - 22:23:24 - Main.IanBowles

 
  • Search: