Type to start searching...

Case

Polymorphic value switch

Properties
case : string

A space separated list of metaclass names, primitive values or 'null' used to drive polymorphic display.

The case part of a polymorphic form switch. This is conceptually similar to a JAVA switch, but for UI. The value property of a parent Switch contains the expression that the cases are evaluated against. If this resolves to a non-primitive, the cases are compared against the non-primitive's class type. Note: The class, all subclasses, and the 'null' case should be handled. If it resolves to a primitive, the cases are compared directly with the value. Note: All possible values and the 'null' case should be handled. That being said Enumerated values and booleans are most appropriate. All possible values must be covered by the cases - there is no 'else' case. Within the Switch the cases are checked from left to right. The first Layout to match will be the one to display.
Example


Non-primitive case: The parent Switch value property is set to EntityList.  This is
a View Path to the the EntityList form.  There are three child Layouts with cases of
1. null 2. Person UserPerson 3. Company.  The currently selected instance in the model of
the EntityList form will determine which Layout will display.  If an instance of Company
is selected in the EntityList then Layout 3 displays.
Primitive case: The parent Switch value property is set to EntityList isPerson.
This is a View Path to the EntityList form and an Association Path to the isPerson attribute.
There again are three child Layouts with cases of 1. null 2. #t 3. #f.  As
we move through the EntityList the Layouts will dynamically display based on the values in case.

codes : string

Association path, or expression providing media codes

converter : uiIdentifier

Converter name. If not specified, value type name is used to generate it.

Valid values based on“string”.
:?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)*

Value must begin with a letter. Case and length are not restricted. Letters and numbers are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.

crop : boolean

True to crop icons

icons : string

Association list of association paths or constants to the icon properties of the items in the collection

Association list of association paths or constants: (image|data|type|icon|default|lock . <a1> ... <an>|"<const>")

Note that this isn't a list of values. It is simply the association path, or expression, to the icon of the items.

It is called icons (plural) because it retrieves the icon(s) from the collection's item(s).

Example


Configuring data table avatar for Entity.meta

<Table>
   <Column ... icons="(image . image)(data . mimeData)(type . mimeType)(icon . icon)(default . &quot;icon:person&quot;)(lock . locking)" .../>
   ...
</Table>

image - The name of the attribute that contains the image (usually of type Obj) from the current instance. The attribute name doesn't need to be called "image", but often is.
data - Obj'mimeData attribute of type binary returning the image data. Always mimeData if the image attribute is of type Obj.
type - Obj'mimeType attribute of type string returning mime type of the image data. Always mimeType if the image attribute is of type Obj.
icon - optional. The name of an attribute of type string returning an icon name if the image is null
default - optional. "icon:person" - A constant expression to fall back on if both image and icon are null
lock - optional. The name of the attribute returning the optimistic locking value. Always locking if the image attribute is of type Obj.

pattern : string

Converter pattern

Examples include


date.m.f
currency.s
shortCurrency
percent
quantity
priceCurrency
shortDate
{0;choice;0||1|{$};*}  - this syntax allows for different treatment of plurals
{@$.fullName;link;;@i}
time.m
datetime.m.f
{@$.fullName;string;}
integer
shortTimestamp
ids.conversationsTo
#,##0.##
date.l.f
longDate
{@$.userPerson.fullName;string;}
internationalPhone

tooltips : string

The attribute, association path, or a constant specifying tooltips.

unit : string

Converter unit association path or expression

values : string

Association path, or expression providing values

Parents