Customizing controls in lists

How to customize controls in lists

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 23.02.2016
Updated: 17.10.2024 | Section ComboBox expression for star row adjusted to version 6.4.0.21.

To override an existing control in a list via customizing, the relevant control must be addressed with Override:

However, you can also create new controls by leaving the control field blank and creating a new control in the control XML field. For example, you can do this for some custom field items, where there is no predefined control. See below Show custom field items in lists.

Changing the width of a column

In this example, we want to widen the code column of the cmbProject control element to 150 by overriding the Width property of the Code column:

<ComboBox Override="cmbProjekt">
    <ComboBox.ColumnDefinitions>
       <ColumnDefinition Override="Code" Width="150" />
    </ComboBox.ColumnDefinitions>
</ComboBox>

For the names of the individual columns of each control, see controls.

Moving a column

In this example, we want to display the column named Regarding as the second column after the Code column. To do this, we set the property PlaceAfter:

<ComboBox Override="cmbProjekt">
    <ComboBox.ColumnDefinitions>
         <ColumnDefinition Override="Regarding" PlaceAfter="Code" />
    </ComboBox.ColumnDefinitions>
</ComboBox>

Adding a new column

Inserting a new column works in the same way, except that we do not use an override this time. This makes it clear that it is a new column. As an expression, we enter the relevant OCL expression:

<ComboBox Override="cmbProjekt">
    <ComboBox.ColumnDefinitions>
       <ColumnDefinition Width="110" Expression="projektleiter" />
    </ComboBox.ColumnDefinitions>
</ComboBox>

If PlaceBefore or PlaceAfter is not specified, the new column is added at the end.

Showing/hiding the navigation button

In the combo box, an arrow can be shown that allows you to navigate directly to the selected object. This then opens in a separate tab or window.

To do this, the ShowNavLinkButton must be set to “True”:

<ComboBox Override="cmbProjekt"
    ShowNavLinkButton="True" />

If you do not want to show an arrow that is displayed by default, set the ShowNavLinkButton to False.

Showing/Hiding the Remove reference button

A delete button x can now be shown in the combo box. This enables an already selected reference to be removed again.

To do this, the ShowRemoveButton must be set to “True”:

<ComboBox Override="cmbTaetigkeit"
    ShowRemoveButton="True" />

Make sure that you only show this button if deleting the reference does not result in an invalid entry.

If you do not want to show a button that is displayed by default, set ShowRemoveButton to False.

Showing a DatePicker

Starting with Vertec 6.2, a DatePicker can be shown in date columns in lists. To do this, you have to enter the following code in the Control XML field:

<DatePicker />

 

A DatePicker is then shown in the relevant column to select the date:

Showing custom fields in lists

The predefined control cmbcustomfield is available for showing selection and object custom fields.

If you want to show custom fields of a different type, do not define a control. Instead, create it directly in the Control XML field. As an example, let’s show a file custom field on the downpayment. You can make the following entries in the custom field:

In the list settings, the relevant control XML is

<PathBox Label="Datei" ValueExpression="zusatzfeld('Datei’)" SelectType="FileOpen" />

A field is shown in the list where the file can be selected:

For a list of which control elements to use for which type, see the XML (Customizing) section in the custom fields item article.

Custom field item ComboBox with object value <> row object

Starting from Vertec 6.1, it is possible to link the ComboBox to an object value that does not originate from the row object.

For example, in the list column of a project list, it should be possible to select a field in a linked custom field item.

  • Expression:
    getlinks('projektstaende’)->oclastype(Zusatzklasse1)
     ->orderby(zusatzfelddate('datum’))
     ->last.zusatzfeldint('status’)
  • Control element: cmbZusatzfeld
  • Renderer: rndZusatzfeld

ComboBox expression for asterix row

With customized ComboBoxes , the ListExpression calculates which controls are shown. This expression refers to the row object in the list.

In the case of Add row (asterix row for new entries), no row object exists yet for the expression to refer to. Therefore, if the ListExpression is not a a globally evaluatable expression, a  GhostrowListExpression must also be used. The context here is the container which contains the list.

Starting with Vertec 6.4.0.21, you can access in the GhostrowListExpression the container (folder or LinkContainer) with the variable varContainer and the object to which the container belongs with varParent.

<ComboBox ListExpression="bearbeiter.erfprojekte->orderby(code)" 
    GhostrowListExpression="if parentEintrag->oclIsTypeOf(Projektbearbeiter) then
    parentEintrag->oclAsType(Projektbearbeiter).erfprojekte else 
    TimSession.allinstances->first.login.erfprojekte endif->orderby(code)" />
 

 

Bitte wählen Sie Ihren Standort