Units

Numbers may be given with these units (default is pt, if no unit is given). All units apart from px take into account the display resolution, e.g. 72 DPI.

  • px - Pixel
  • pt - Points
  • mm - Millimeter
  • cm - Centimeter
  • em - Font-Width
  • ex - Font-Size
  • ln - Line-Height
  • in - inch
  • pc - pica (1 pc = 12 pt)

Color definitions

Up to now colors can only be specified as RGB color. The RGB value must be given as a hexadecimal number prefixed with # (like in html): #rrbbgg, where rr specifies red, bb blue and gg green value. Its also possible to define the color with an integer value (without preceding #): ((red * 256) + blue) * 256 + green. But one should prefer the html-like syntax.

Example

Red=100, Blue=150, Green=25: #649619 or 6592025

Style definition

Styles may be applied inline or using a style definition or using both. In the later case, inline styles override the inherited style from the style definition.

<root>
  <style name="my-style-1" ..../>
  <style name="my-style-2" style="my-style-2" ..../>
   
  <item widgetype="editfield" label="Name" label-style="my-style-1" style="my-style-2" .../>
  ...
</root>

Font and text properties

Note that the attributes loosely follow the CSS property names.

  • font-family - font name
  • font-size - font size
  • font-style - normal | italic, defaults to normal
  • font-weight - normal | bold, defaults to normal
  • text-align - left | center | right | justify, defaults to left

Example

<style name="font-style"
       font-family="Helvetica"
       font-size="24"
       font-style="italic"
       font-weight="bold">
</style>
 
<item widgettype="statictext" sourcetype="value" source="Example" style="font-style"/>

font example

Margin, Border and Padding

Each widget can be surrounded by (from the inner to the outer): padding, border and margin. The size/width of margin, border and padding can be specified individually for each side.

The margin is transparent, i.e. is painted in the background color of the parent container. However the padding area has the same background color as the widget. The color of the border can be specified.

  • margin - Size of the margin on each side (default 0).
  • margin-top, margin-left, margin-bottom, margin-right - Alternative: Specifies margin size for each side individually.
  • border-width - Size of the border (default 0).
  • border-width-top, border-width-left, border-width-bottom, border-width-right - Alternative: Specifies border size for each side individually.
  • border-color - Color of the border (default black).
  • padding - Size of the padding on each side (default 0).
  • padding-top, padding-left, padding-bottom, padding-right - Alternative: Specifies border size for each side individually.

Example

<style name="label-style" margin="20" border-width="2" border-color="1671071" padding="5"/>
<item border-width="1">
  <item widgettype="statictext" style="label-style"
        source="Label with margin, border and padding" sourcetype="value"/>
</item>

border example

Colors

  • color - RGB value of content foreground color, e.g. text color of a label (default black).
  • background - RGB value of padding and content background color (default white).
  • border-color - RGB value of border color (default black).

Example

<item background="16777000" border-width="5" border-color="16717071" padding="10">
  <item widgettype="statictext" source="Roter Rahmen und gelber Hintergrund" sourcetype="value"/>
</item>

border example

Widget Sizes

Each widget has default sizes. E.g. the width of a label is setup large enough to display all text. The layout manager typically uses this preferred size and assures that is lies between minimum and maximum size. The defaults of each component may be overridden by specifying these style properties:

  • width, height - Preferred size (default depends on widget and content).
  • minwidth, minheight - Minimum size (default 0).
  • maxwidth, maxheight - Maximum size (default unlimited).

Example

<item border-width="1" padding="5" margin="10">
  <item widgettype="statictext" source="Label in preferred size" sourcetype="value" border-width="2"/>
  <item widgettype="statictext" width="300" height="60" source="Label in fixed size 300 x 60" sourcetype="value" border-width="2"/>
</item>

border example

Label Styles

For widgets with specified label attribute all style attributes are applied on the widget (e.g. editfield) and not on the label. To change the style of the label special attributes must be set. With the attribute label-style a predefined style definition can be used for the label. To specify or overwrite individual style attributes every style attribute must be prefixed with “label-”. For example: label-border-width=“2” sets a 2 pixel thick border around the label. Or label-width=“100” makes the label 100 pixel wide. The old attribute labelwidth is still supported, but should be replaced
by label-width.

Examples

Here a predefined style label-style2 is applied on the editfield’s label:

<style name="label-style2" font-family="Helvetica" font-size="12" font-weight="bold"
       border-width="2" border-color="16717071"/>
<item border-width="1" padding="5">
  <item widgettype="editfield" label="Name:" width="150" source="Field with label" sourcetype="value"
        label-style="label-style2"/>
</item>

The same result can be achieved be specifying each style attribute separately:

<item border-width="1" padding="5">
  <item widgettype="editfield" label="Name:" width="150" source="Field with label" sourcetype="value"
        label-font-family="Helvetica" label-font-size="12" label-font-weight="bold"
        label-border-width="2" label-border-color="16717071"/>
</item>

border example

Default Styles

Global Default Style

It’s possible to specify default styles for widgets. The global default style, which applies for all widgets, can be set
via a style definition with empty name "". In the following example the global default style defines a yellow background color for all widgets and containers.

<style name="" background="16777000"/>
<item border-width="1" padding="5">
  <item widgettype="statictext" source="Default background yellow" sourcetype="value"/>
</item>

border example

Containers are handled different. Only the background color of the global default style is taken into account and applied to the top-level container (child containers are transparent). All other style properties are ignored. This means for example if a border is set in the default style, that border is drawn around all widgets but not around containers. Imagine one wants to provide default paddings for all components. In that case it would be undesirably, if the padding was applied to all containers too.

In the following example the default padding of 10 pixels and the red borders are used for the labels but not for the sourrounding containers.

<style name="" border-width="2" border-color="16717071" padding="10"/>
<item align="down" border-width="1">
  <item align="right">
    <item widgettype="statictext" source="Label1" sourcetype="value" width="100"/>
    <item widgettype="statictext" source="Label2" sourcetype="value" width="100"/>
  </item>
  <item align="right">
    <item widgettype="statictext" source="Label3" sourcetype="value" width="100"/>
    <item widgettype="statictext" source="Label4" sourcetype="value" width="100"/>
  </item>
</item>

border example

On the other hand if one want’s to change style properties for specific containers, this can be done on the container directly. Either by specifying a style or by setting single style attributes.

Widget Default Styles

Its also possible to define individual default styles for different types of widgets. Just speciyify attribute default-for in the style definition. The value of the attribute must be the name of the widget for which the style should be applied.

Examples:

Default style for all labels: Helvetica 12pt bold

<style name="label-default" default-for="label" font-family="Helvetica" font-size="12" font-weight="bold"/>

Default style for all text fields (widgettype “editfield”): Helvetica 12pt, text color black

<style name="textfield-default" default-for="editfield" font-family="Helvetica" font-size="12" color="0"/>

Layout Management

Container Layout

XMLEditor uses just one layout manger - a nested BoxLayout. In each box components can be arranged either horizontally (with and without line breaks) or vertically. The layout manager tries to give each component it’s preferred size. Optionally weights can be specified for each component to tell the layout manager, which components like to be wider or higher than their preferred sizes.

The general syntax for a container is:

<item align="..." [optional style attributes]>
  <item [component 1]/>
  ...
  <item [component n]/>
</item>

The following values are allowed for the attribute align:

  • right

    Components are arranged horizontally from left to right.
    The components are aligned to each other according to their align-y
    attribute (default is “top”). If possible, the container will be made large
    enough to fit in all of it’s components. No line breaks occure.
    This is the default container alignment.

  • down

    Components are arranged vertically from top to bottom.
    The components are aligned to each other according to their align-x
    attribute (default is “left”). If possible, the container will be made large
    enough to fit in all of it’s components.

  • right-down

    A kind of flow-layout with line breaks.
    Components are arranged horizontally from left to right.
    If the container width is not large enough to store all sub components on
    one line, a line break occures and the rest of the components is
    positioned on the next line and so on.

    Nevertheless the layout manager tries to make the container as wide
    to place all components on one line, if possible. That means to see a line
    break one has to provide a limit on the container size. Either manually
    by specifying a maximum width or implicitly by making the window size smaller.

    The components themself are always top-aligned to each other.
    That means specifying an align-y attribute has no effect.

  • fillright

    deprecated Same as “right-down”.

Examples

In the following example all three possible container alignments are combined. The top-level container A has a “down” alignment, the container B a “right” alignment and container C aligns its components “right-down”.

<item align="down" border-width="2" border-color="16717071" maxwidth="400">
  <item widgettype="statictext" source="Container A (DOWN alignment)" sourcetype="value" margin="5" border-width="1"/>
  <item align="right" border-width="2" border-color="16717071" margin="5">
    <item widgettype="statictext" source="Container B (RIGHT alignment)" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label2" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label3" sourcetype="value" border-width="1" margin="5"/>
  </item>
  <item align="right-down" border-width="2" border-color="16717071" margin="5">
    <item widgettype="statictext" source="Container C (RIGHT-DOWN alignment)" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label4" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label5" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label6" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label7" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label8" sourcetype="value" border-width="1" margin="5"/>
    <item widgettype="statictext" source="Label9" sourcetype="value" border-width="1" margin="5"/>
  </item>
</item>

border example

Widget Alignment

Each widget has alignments for horizontal and vertical directions. The alignment defines how a component is positioned in a container, if there’s available space left, which is not used by the component itself.

The alignment of a component can be specified with the following attributes:

  • align-x - Horizontal alignment of components to each other
    in containers with vertical (= down) alignment.

Possible values: left | center | right | 0.0 … 1.0, where 0 is left (default left).
* align-y - Vertical alignment of components to each other
in containers with horizontal (= right) alignment.

Possible values: top | center | bottom | 0.0 … 1.0, where 0 is top (default top).

Example for vertical alignment

The following container lays out its components horizontally. The component with the maximum height (widget E) defines the container’s height. All other components are smaller, so there’s available space in vertical direction. Those components are placed according to their align-y attribute.

<item align="right" border-width="2" border-color="16717071">
  <item widgettype="statictext" align-y="center" source="A: Center" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-y="top" source="B: Top" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-y="bottom" source="C: Bottom" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-y="0.8" source="D: 0.8" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-y="0.0" height="100" source="E: Height 100" sourcetype="value" border-width="1" margin="5"/>
</item>

border example

Example for horizontal alignment

The following container lays out its components vertically. The component with the maximum width (widget E) defines the container’s width. All other components are smaller, so there’s available space in horizontal direction. Those components are placed according to their align-x attribute.

<item align="down" border-width="2" border-color="16717071">
  <item widgettype="statictext" align-x="center" source="A: Center" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-x="left" source="B: Left" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-x="right" source="C: Right" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-x="0.2" source="D: 0.2" sourcetype="value" border-width="1" margin="5"/>
  <item widgettype="statictext" align-x="0.0" width="100" source="E: Width 300" sourcetype="value" border-width="1" margin="5"/>
</item>

border example

Example for aligned Containers

Of course x- and y-alignments can also be specified for containers, which are normal components too. In this example three containers have different vertically alignments inside a parent container with horizontal alignment.

<item align="right" border-width="2" border-color="16717071" height="140">
  <item align="right" border-width="2" border-color="16717071" align-y="center" margin="2" padding="5" height="60">
    <item widgettype="statictext" source="Container Center" sourcetype="value"/>
  </item>
  <item align="right" border-width="2" border-color="16717071" align-y="top" margin="2" padding="5" height="60">
    <item widgettype="statictext" source="Container Top" sourcetype="value"/>
  </item>
  <item align="right" border-width="2" border-color="16717071" align-y="bottom" margin="2" padding="5" height="80">
    <item widgettype="statictext" source="Container Bottom" sourcetype="value"/>
  </item>
</item>

border example

Widget Weights (Dynamic sizes)

To adjust a component’s size dynamically to use the available space (e.g. window size), weights can be specified. E.g. a weight > 0 on a component says that this component likes to get additional space (if available). If a weight is not specified or weight is 0, that widget will never become additional space. It will be as large as it’s preferred size specifies, but not larger. Weights can be specified for both horizontal and vertical space individually.

Each weight is an arbitrary positive number and specifies the weight among all components at this level (i.e. all widgets in this container). If - after satisfying the preferred size requirements - available space is left, it is ditributed among the components according to their fraction of the total weight (= sum of all weights).

The following attributes can be set to define a component’s weights:

  • weight-x - Horizontal weight, i.e. component likes to be as wide as possible.
  • weight-y - Vertical weight, i.e. component likes to be as tall as possible.

Example for horizontal weights

Here the right component gets 2 / (1 + 2) = 2/3 of the available horizontal space and the left component gets the remaining 1/3. I.e. the right widget is always twice as wide as the left one.

<item border-width="1" padding="5" align="right" maxwidth="500">
  <item widgettype="edittext" weight-x="1" border-width="2" border-color="16717071"
        padding="5" source="Weight-X = 1" sourcetype="value"/>
  <item widgettype="edittext" weight-x="2" border-width="2" border-color="16717071"
        padding="5" source="Weight-X = 2" sourcetype="value"/>
</item>

border example

Example for vertical weights

In this example three components are positioned vertically in a container with fixed height of 250 pixels. The first component (the label) does not specify a vertical weight, hence it is not larger than it’s preferred height. The remaining vertical space is distributed equally to the two textareas, since they define identical y-weights > 0.

<item align="down" width="400" height="250" padding="5" border-width="1">
  <item widgettype="statictext" source="No Weight-Y" sourcetype="value" border-width="2" border-color="16717071"
        padding="5" margin="1"/>
  <item widgettype="edittext" weight-y="1" width="200" border-width="2" border-color="16717071"
        padding="5" source="Weight-Y = 1" sourcetype="value" margin="1"/>
  <item widgettype="edittext" weight-y="1" width="150" border-width="2" border-color="16717071"
        padding="5" source="Weight-Y = 1" sourcetype="value" margin="1"/>
</item>

border example

Example for weight calculation

<item>
  <item ... width="100px" weight-x="1"/>
  <item ... width="50px" weight-x="0.5"/>
</item>

The total preferred width of the two components is 150px. If the enclosing component, e.g. window, has 600px, 450px are left as
additional space. The first item in this example gets an additional width of 1 / (1 + 0.5) * 450px = 300px, makes it 400px wide. The second item gets an additional width of 0.5 / (1 + 0.5) * 450px = 150px, which makes it 200px wide.

Example for weight-y in horizontal aligned container

Apparently it makes no sense to specify a y-weight in containers with horizontal alignment, since components are positioned from left to right. But look at the following picture. No y-weights are specified for the two textareas. Hence they are not larger than their preferred height of 100 pixels, allthough the container has a fixed height of 150 pixels.

<item padding="5" align="right" maxwidth="500" height="150" border-width="2" border-color="16717071" >
  <item widgettype="edittext" weight-x="1" border-width="2" border-color="16717071" padding="5"
            source="No Weight-Y" sourcetype="value" height="100"/>
  <item widgettype="edittext" weight-x="1" border-width="2" border-color="16717071" padding="5"
            source="No Weight-Y" sourcetype="value" height="100"/>
</item>

border example

In the next case vertical weights have been set for both components. This tells the layout manager that both components like to get as much additional vertical space as possible. Since the container alignment is horizontal, both components get the total height of the container, allthough they have specified different y-weights. In this example the portion of the y-weight of the total weight is not of interrest. It’s ok to specify any y-weight greater 0.

<item padding="5" align="right" maxwidth="500" height="150" border-width="2" border-color="16717071" >
  <item widgettype="edittext" weight-y="1" weight-x="1" border-width="2" border-color="16717071"
            padding="5" source="Weight-Y = 1" sourcetype="value"/>
  <item widgettype="edittext" weight-y="2" weight-x="1" border-width="2" border-color="16717071"
            padding="5" source="Weight-Y = 2" sourcetype="value"/>
</item>

border example

Auto width or height - DEPRECATED

To make a widget as wide or as tall as possible you can say width=“auto” or height=“auto”. However this is deprecated now. Specify a horizontal or vertical width for the component instead. It’s also a good idea to specify a width/height or minumum width/height anyway, since this will be used by the layout manager to calculate the (minimum or preferred) size of the component, if no window size is known in advance.

Old deprecated way:

<item widgettype="editfield" label="$asset_name" labelwidth="100" width="auto" source="@name"/>

New way:

<item widgettype="editfield" label="$asset_name" label-width="100" weight-x="1" width="100" source="@name"/>

Widgets with Labels

For convenience it is possible for all types of widgets (except bare containers) to set a label attribute.

For example a textarea with a label:

<item widgettype="edittext" label="Label: " width="150" height="100"/>

This will result in an implicit right-aligned container, which contains both the label and the (text) widget. The label is always positioned left of the widget. The following image shows the result (the container is normally invisible, but marked here with a red border for clarity):

border example

Both components are per default top-aligned. However the alignment of the widget can be changed via attribute align-y, the alignment of the label by attribute label-align-y.

The above layout definition is a shortcut for specifying each of text widget, label and container separately. I.e. it is the same as the following layout definition:

<item align="right">
  <item widgettype="statictext" source="Label: " sourcetype="value"/>
  <item widgettype="edittext" width="150" height="100"/>
</item>

Its also possible to place the label above the widget instead of left of it. Just set an align attribute with value “down” (default is “right”). This leads to an invisible down-aligned container (marked red in the following image).

<item widgettype="edittext" label="Label:" align="down" width="150" height="100"/>

border example

Both components are per default left-aligned. But again the alignment of both the widget and the label can be changed via attributes align-x and label-align-x respectively.

As mentioned already in section “Label Styles”, all style attributes are applied on the widget itself, i.e. not on the label and not on the surrounding container. Style attributes, which are prefixed with “label-” affect the label. However it is not possible to define style attributes (e.g. margin or border) for the container.

For example: The following widget definition defines a border, which is drawn only around the textfield and not around both the label and the textfield.

<item widgettype="edittext" label="Label: " width="150" height="100" border-width="2"/>

border example

Restrictions, Special Cases and Deprecations

A)

<item label="Name"/>

DEPRECATED Will be changed into a single label widget without container. Child widgets are not (any longer) allowed! It leads to the same as the following widget definitions, which should be used preferred:

<item widgettype="statictext" source="Name" sourcetype="value"/>

or NEW

<item widgettype="label" value="Name"/>

B)

<item label="Name">
  <item ...>
  ...
</item>

Illegal, since labels no longer allowed for containers!

Replace with:

<item align="right|down">
  <item widgettype="label" value="Name"/>
  <item ...>
  ...
</item>

C)

<item widgettype="group" label="...">

Illegal, since labels not allowed for container-widgets!

D)

<item widgettype="...">
  <item ...>
  ...
</item>

Allowed only for “group” widgets. Illegal for all other widget types, since child widgets are now only allowed for containers and container-widgets (like groups), not for “base” widgets.

Widget definition

Widget Alignment

Widgets are placed within containers according to their alignment (align attribute).

  • align - right | down | right-down (fillright), layout sub components, defaults to right

Example 1:

<root>
  <item widgettype="editfield" label="Name" label-style="my-style1" style="my-style2" source="$other.asset@name">
</root>

Layout is

  • container with right-alignment (default) having these sub items:
    • static text as label
    • editable field with content asset@name of data source “$other”

Example 2:

<item widgettype="editfield" label= ... align="down">
  <item widgettype="editfield" label= ... align="right"/>
</item>

Layout is

  • container with down-alignment
    • static text as label
    • editable field with content asset@name of data source “$other”
    • container with right-alignment
      • static text as label
      • editable field with content asset@name of data source “$other”

Special Widget Attributes

  • enabled = true | false
  • enableddef = key-path
  • readonly = true | false
  • readonlydef = key-path

Referencing data

The source attribute specifies the path to the value:

source="$data.party.record@name"

The “$data.” prefix denotes the data source, which is application specific. By convention, $data denotes the “main” to work with. “$data” may be omitted.

Nesting and looping in data

Use select=“true” to select local data root. The second item denotes party.record@name:

<item source="party.record" select="true">
  <item ... source="@name"/>
</item>

Creates items for all record elements of party:

<item source="party.record" loop="true">
  <item ... source="@name"/>
</item>

Lookup definitions

Inline options definition

<options name="options1">
  <option label="normal" value="normal" />
  <option label="halbfett" value="bold" />
  <option label="kursiv" value="italic" />
  <option label="Infoschrift" value="infoschrift" />
  <option label="Thema rot" value="thema_rot" />
</options>

Reference to data

<options name="options2" source="$data.options" value="@id" label="@title" />

Note that the value and label attributes default to “@value” and “@label”, which allows the above inline definition without these attributes.

Usage with popups:

<item widgettype="popupmenu2" options="options2" source="..." />

May be specified inline as well:

<item widgettype="popupmenu2" source="...">
  <options name="options1">
    <option label="normal" value="normal" />
    <option label="halbfett" value="bold" />
    <option label="kursiv" value="italic" />
    <option label="Infoschrift" value="infoschrift" />
    <option label="Thema rot" value="thema_rot" />
  </options>
</item>

Usage as lookup:

<item widgettype="statictext" lookup="options1" source="..." />

Initializing data

defaultvalue, inititem.item, override

Filtering / matching

If present, items are only displayed, if any of the filter entries match:

<item widgettype="editfield" source="@name">
  <filters>
    <filter match="" matchtype="value" operator="<&gt;" source="@name"/>
  </filters>
</item>

Filters may be specified by reference as well. Defaults to “filters.filter” - that is inline.

Widgets

Checkbox - checkbox

Additional attributes:

  • caption - checkbox text
  • captionbold - true|false bold checkbox text; DEPRECATED
  • checkedvalue - value to set when checked, defaults to “true”
  • uncheckedvalue - value to set when unchecked, defaults to “false”

Examples:

<checkbox caption="$asset_mydomain" captionbold="true" source="@corpus:mydomain"/>
<checkbox source="@islogo" uncheckedvalue="0" checkedvalue="1"/>

Radiobutton - radiobutton

Additional attributes:

  • checkedvalue - value to set when checked (a radiobutton does not set any value when unchecked)

Examples:

<radiobutton caption="good"   captionbold="false" checkedvalue="1" source="@feeling"/>
<radiobutton caption="better" captionbold="false" checkedvalue="2" source="@feeling"/>
<radiobutton caption="great"  captionbold="false" checkedvalue="3" source="@feeling"/>

Color Picker - colorpicker

The RGB color value is stored as integer using:

((colorValue.red * 256) + colorValue.green) * 256 + colorValue.blue

Example:

<colorpicker label="$asset_color" labelwidth="100" width="16" height="16" source="@color"/>

Delete Button - deletebutton

Additional attributes:

  • confirmmessage - display confirmation dialog with this message

Note how source is treated: if empty, perform delete on node, if non empty perform clear (set to null) of attribute.

Examples:

<deletebutton source="@color"/>
 
<foreach source="asset_keyword" newcaption="$asset_new_keyword" align="down">
  <inititem>
    <item path="@new-fct:id" source="$AUTOVAL" sourcetype="value" override="true" />
    <item path="@keyword" source="root." sourcetype="value" />
  </inititem>
  <box align="right">
    <label value="$asset_keyword" width="100" source="@keyword"/>
    <deletebutton/>
    <popupmenutree width="80" source="@keyword" hiderootpopup="false"
        optionssource="keywords.keyword" optionssourceloop="keyword" optionssourcetype="defpathglobal"
        optionslabelsource="@name" optionsvaluesource="@shortname"/>
  </box>
</foreach>

Drag item - dragitem

Additional attributes:

  • dragitem@name: name of root element to create
  • dragitem.item<>@path: path to put value
  • dragitem.item<>@source: path or value (sourcetype = “value”)
  • dragitem.item<>@sourcetype: refpath, refpathtop, refpathglobal, defpath,
    defpathtop, defpathglobal, value, defaults to refpath

or

  • dragitem.item<>@special:
  • refpath: absolute refpath (including indexes “<>”)
  • selectstart: current text selection start of associated text field
  • selectlength: current text selection end of associated text field
  • selectedtext: current text selection of associated text field

Note: selectstart and selectLength take the selection of the text field that has the current focus (focus ring) and verifies that its absolute refpath matches the one of the draggable item. If no item has the focus, the value of the dragitem item (item@refpath) is used.

Sample:

<item widgettype="dragitem">
  <dragitem name="item">
    <item path="@key" sourcetype="value" source="time" />
    <item path="@value" sourcetype="refpath" source="@date" />
  </dragitem>
</item>

The resulting drag item text would look like (assuming @date having the value “10.2.2003”):

<item key="time" value="10.2.2003"/>

Date - editdate

Additional attributes:

  • mode - “search” for search dialog

Example:

<editdate label="$asset_deadline" label-width="100" weight-x="1" source="@deadline"/>

Static text - statictext

Examples:

<statictext sourcetype="value" source="$schedule_step"/>
<statictext source="@step"/>

Label - label

Examples:

<label value="$asset_keyword" width="100"/>

Text field - editfield

editable text field

Example:

<editfield label="$asset_name" label-width="100" weight-x="1" source="@name">
  <validate notempty="true"/>
</editfield>

Text box - edittext

Multiline editable text field width scroll bar

Additional attributes

  • mode - xml: display xml starting at @source (points to xml element node),
    diff-words: display word-by-word difference between @source and @source2, otherwise just display text

Example:

<edittext label="$asset_annotation" weight-x="1" source="@annotation" align="down"/>

Group box - group

Grouping container, i.e. a container with title and frame around sub items.

Additional attributes:

  • caption - group title
  • captionbold - true|false bold title; DEPRECATED
  • align - right|down the container alignment

Example:

<group caption="$address_organisation" align="down">
  <editfield width="260" source="address@organisation" readonly="false" />
  <editfield width="260" source="address@organisation2" readonly="false" />
  <editfield label="$address_role" labelwidth="80" width="178" source="address@role" readonly="false"/>
</group>

Button - button

Additional attributes

  • caption - button text
  • confirmmessage - display confirmation dialog with this message
  • method - method to invoke

Example:

<button caption="$general_select" method="selectfolder" source="export@exportfolder"/>

Insert button - insertbutton

Standard insert button control for XMLEditor. Compare with loop, maxoccurs and insertbefore attributes of XMLEditor.

Additional attributes (shared with item that has loop attribute set):

  • newcaption - optional button text, or if not set uses "new " + caption

Listbox - listbox

@width: widget with or ("auto")
@minwidth: minimum with in case @width="auto"
@height: widget height
@rowheight: row height (<=12: text lines, pixels otherwise)
@gridlinesvertical: default, none, thindotted, thinsolid, thicksolid, doublethinsolid
@gridlineshorizontal: default, none, thindotted, thinsolid, thicksolid, doublethinsolid
column items contain the column definitions
columns.column<>@title: title shown in title row
columns.column<>@source: source path (uses source of listbox as root)
columns.column<>@width: column with absolute or percentage or auto ("10", "50%", "auto")
columns.column<>@minwidth: minimum with in case of width = percentage or auto
columns.column<>@minwidth: minimum with in case of @with="auto"
columns.column<>@valuetype: string, integer, double, date (used for sorting)
dragitem: for row drag
rows@source: loop over this to get each row (based on @source, @sourcetype)
rows.filters: filter rows

Example:

<listbox width="auto" height="auto" minheight="80" rowheight="1"
    gridlinesvertical="none" gridlineshorizontal="thinsolid" hasheading="true"
    source="child-assets" sourcetype="refpath">
  <rows source="asset">
  </rows>
  <columns>
    <column title="$address_gender" source="address@gender" lookupsource="options.option" lookupsourcetype="defpath" align="left" width="40" >
      <options>
        <option label="$address_gender_male" value="male"/>
        <option label="$address_gender_female" value="female"/>
      </options>
    </column>
    <column title="$address_title" source="address@title" align="left" width="15%" minwidth="40" />
    <column title="$address_lastname" source="address@lastname" align="left" width="15%" minwidth="40" />
    <column title="$address_firstname" source="address@firstname" align="left" width="15%" minwidth="40" />
    <column title="$address_role" source="address@role" align="left" width="15%" minwidth="40" />
    <column title="$address_phone" source="address@phone" align="left" width="15%" minwidth="40" />
    <column title="$address_fax" source="address@phone_fax" align="left" width="15%" minwidth="40" />
  </columns>
</item>

Picture - picture

@width = "auto" will use picture size, otherwise picture will be scaled to given width and height

Additional attributes

  • scale - current scaling, defaults to 1 (100%). If 0, scaling is not allowed.

Popup menues - popupmenu, popupmenu2, popupmenu3

  • popupmenu uses “real” popup menu controls
  • popupmenu2 uses bevel buttons with menus (typically better performance)
  • popupmenu3 uses text fields with drop down lists (allow for tabbing and up/down key)

Additional attributes

  • @optionssource defaults to “options.option”
  • @optionssourcetype defaults to “defpath”
  • @optionsvaluesource defaults to “@value”
  • @optionslabelsource defaults to “@label”

Examples:

<popupmenu source="@type"
    optionssource="asset_typedefs.asset_typedef" optionssourcetype="refpathglobal"
    optionslabelsource="@description" optionsvaluesource="@asset_type"/>
<popupmenu source="@wf_id" optionssource="workflows.workflow"
    optionssourcetype="defpathglobal" optionslabelsource="@name"
    optionsvaluesource="@id" source2="@wf_step" optionsvaluesource2="@def_step"/>
<popupmenu source="@non_owner_access" defaultvalue="0">
  <options>
    <option label="$asset_non_owner_access_0" value="0"/>
    <option label="$asset_non_owner_access_1" value="1"/>
    <option label="$asset_non_owner_access_2" value="2"/>
  </options>
</popupmenu>

@optionssourcetype=“suboption” signs that this popup belongs to hierarchical popup group (previous item must be of same type, that is popupmenu, popupmenu2 or popupmenu3)

Cascading popup - popupmenutree

Example:

<popupmenutree width="80" source="@domain" hiderootpopup="false"
   optionssource="domains.domain" optionssourceloop="domain" optionssourcetype="defpathglobal"
   optionslabelsource="@name" optionsvaluesource="@shortname"/>

Separator - separator

Separator line.

Window Splitter - splitter

Additional attributes

  • @split - horizontal|vertical split orientation
  • @divider-pos - divider position

<splitter split="horizontal" divider-pos="250">
  <topleft-box minheight="100" align="down">
    <include key="user-table"/>
  </topleft-item>
  <bottomright-box minheight="100" align="down" scrollbar="true">
    <xmleditor readonly="true">
      <item is-multi-content="true" sourcedeftype="statepath"
            sourcedef="user-table-selection.selections">
        <include key="user-detail"/>
      </item>
    </xmleditor>
  </bottomright-item>
</splitter>

Include- includeitem

Additional attributes

  • key - key of dialog definition to be included

Example:

<dialog-part key="dialog_asset_edit_preview" id="dialog_asset_edit_preview" visibility="public">
  <box align="down">
    <assetpreview weight-x="1" scale="0.25"/>
    <include key="dialog_asset_edit"/>
  </box>
</dialog-part>

Select case - selectcase

Switch on value (continue with items below case). If no items below, will through next case with items.

selectcase.case<0>@value
  item(s) for case<0>
selectcase.case<1>@value
selectcase.case<2>@value
  item(s) for case<1> (fall through) and case<2>
selectcase.defaultcase
  item(s)
 
selectcase.case<>@enabled
  or
selectcase.case<>@enableddef
 
  case enabled (active) only if @enabled or @enableddef evaluates to true (will not
  invoke defaultcase if false).
 
selectcase.match<>
selectcase.match<>@source: path or value (sourcetype = "value")
selectcase.match<>@sourcetype: refpath, refpathtop, refpathglobal, defpath, defpathtop, defpathglobal, value, defaults to  refpath
 
selectcase.match<>@enabled
  or
selectcase.match<>@enableddef

Example:

<selectcase source="@style" align="down">
  <case value="Tabellen_Kasten">
    <popupmenu label=" " width="300" source="text">
      <options>
        <option label="$dialog_label_translation_standard" value="s"/>
        <option label="$dialog_label_translation_optional" value="o"/>
        <option label="$dialog_label_translation_na" value="-"/>
      </options>
    </item>
  </case>
  <defaultcase>
    <edittext width="300" height="50" source="text"/>
  </defaultcase>
</selectcase>