Effector 6.3 developer manual

XML reference 6.3

Effector Studio 6.3 summary

Effector Studio 6.3 manual

Effector 6.2 developer manual

XML reference 6.0

Effector Studio 3.2 summary

Effector Studio 3.2 manual

Drop down list datasource

The file facilitating the definition of drop-down lists is called ComboDefinition. Its main goal is to define sets of values for drop-down lists and make them reusable.

Location in the system

Its physical location is in the ComboDefinitions folder. The ComboDefinition always occurs as a reference, it cannot be used in itself. Its location within the system is shown in the following figure:

ComboBox relationships

Available features

  • Datasource definition
  • Definition of values and display fields

Datasource definition

Example:

<ComboDefinition xmlns="http://effector.hu/schema/ns/combodefinition">
    <SourceType>Database</SourceType>
    <Source>
        <Database>
            <SelectionString>
                <![CDATA[
                    SELECT p.PeopleID, p.Name as PeopleName
                    FROM People p WITH(NOLOCK)
                    INNER JOIN [User] u WITH(NOLOCK) ON p.PeopleID=u.UserID
                    WHERE u.Deleted = 0
                        AND p.Deleted = 0
                        AND 1=1
                    ORDER BY p.Name
                ]]>
            </SelectionString>
            <KeyColumnDefinition>p.PeopleID</KeyColumnDefinition>
            <KeyColumn>PeopleID</KeyColumn>
            <ValueColumn>PeopleName</ValueColumn>
        </Database>
    </Source>
</ComboDefinition>

<ComboDefinition xmlns="http://effector.hu/schema/ns/ComboDefinition">
    <SourceType>XML</SourceType>
    <Source>
        <FixedValues>
            <Value key="1">apple</Value>
            <Value key="2">pear</Value>
        </FixedValues>
    </Source>
</ComboDefinition>

For the datasource definition two nodes can be used, one of them defines the type of the relationship, while the other specifies the SELECT statement.

  • SourceType: The type of the relationship maybe Database or XML.
  • Source: in case of a SourceType=Database a SELECT statement runs a query on the list of values. In the WHERE clause, it is advisable to sort the data and insert the 1=1 expression for a later filtering. The system will replace this 1=1 condition with the appropriate filter expression. The SELECT statement must have at least two fields.

Definition of value and display fields

One of the two fields queried by a select statement represents the value of the ComboBox, while the other signifies the description to be displayed. In the ComboBox, a list of key-value pairs is displayed.

Available nodes:

  • KeyColumn: A value (key) representing one row of the ComboBox.
  • ValueColumn: A displayable field related to the key.

Coloring items

You can set CSS class for the each item of a combobox, therefore you can color the items. The CSS classes can be defined in the delivery/gfx/style.css file. The function can be enabled in the ComboDefinition file.

If SourceType of the combobox is set to XML then you can set the name of the CSS class in cssClass setting on Value item.

Example:

<?xml version="1.0" encoding="utf-8"?>
<ComboDefinition xmlns="http://effector.hu/schema/ns/combodefinition">
  <SourceType>XML</SourceType>
  <Source>
    <FixedValues>
    <Value key="Egyeb" cssClass=”red”>Egyéb</Value>
    </FixedValues>
  </Source>
</ComboDefinition>

If SourceType of the combobox is set to Database then you can set the name of the column wich contains the name of the CSS class in Source/Database/CssClassColumn setting.

Example:

<?xml version="1.0" encoding="utf-8"?>
<ComboDefinition xmlns="http://effector.hu/schema/ns/combodefinition">
    <SourceType>Database</SourceType>
    <Source>
     <Database>
         <SelectionString>
             <![CDATA[
                SELECT ProbabilityID
                , Name AS ProbabilityName
                ,CASE WHEN Weight < 0.4 THEN 'red' WHEN Weight < 0.7 THEN 'yellow' ELSE 'green' END AS  ProbabilityCellClass
                FROM Probability WITH (NOLOCK)
                WHERE Deleted=0 AND 1=1
                ORDER BY Sort
            ]]>
         </SelectionString>
         <KeyColumn>ProbabilityID</KeyColumn>
         <ValueColumn>ProbabilityName</ValueColumn>
         <CssClassColumn>ProbabilityCellClass</CssClassColumn>
     </Database>
    </Source>
</ComboDefinition>

  • Last update: 2 weeks 5 days ago
  • Effector