Skip to main content
Skip table of contents

Field Editors

Definition

A Field Editor works like an Attribute Editor to display and use a data not bound to an Attribute.

It is possible to configure Field Editors on a Screen, in a way similar to Attribute Editors, with associated rules. When the Feature is submitted, the field inputs are separate from the attribute inputs.

The values entered in the Field Editors are not stored in the database.

A Field Editor is configured to display or edit a field by using a dedicated Widget (date, text, number...).

A Field Editor can be used in Workflow with a double validation. In this case, a script task with a skip expression must be configured. The user task will not launch for a user (according to the configuration in the script task).

Configuration

This Widget defines how the attributes will be presented depending on the mode:

  • READ to display the field.

  • READ_WRITE to edit the field.

The configuration is similar to an Attribute Editor, only the widget id changes: "FieldEditorWidgetType" instead of "AttributeEditorWidgetType".

Example

Field Editor with Select Edit Widget

Field Editor with Advanced Object Reference

CODE
<widget id="applyTo" xsi:type="ctdbum:FieldEditorWidgetType">
	<hidden>false</hidden>
	<config>
		<editor>
			<editWidget xsi:type="ctdbum:SelectEditWidgetType">
				<hidden>false</hidden>
				<config>
					<defaultValue xsi:type="xs:string">Entity</defaultValue>
					<required>true</required>
					<options/>
					<sort>AUTO</sort>
				</config>
			</editWidget>
		</editor>
		<label></label>
		<lockedInUi>false</lockedInUi>
		<mode>READ_WRITE</mode>
		<multiValued>false</multiValued>
		<choicesRule>
			<script><![CDATA[
return ChoicesRuleResult.of("ui.model.fields.applyTo.values", ["Entity"])
       		]]></script>
		</choicesRule>
	</config>
	<fieldId>applyTo</fieldId>
</widget>

CODE
<widget id="structuresToAdd" xsi:type="ctdbum:FieldEditorWidgetType">
	<hidden>false</hidden>
	<config>
		<editor>
			<editWidget xsi:type="ctdbum:AdvancedObjectReferenceEditWidgetType">
				<hidden>false</hidden>
				<config>
					<required>true</required>
					<popupAttributes>
						<attribute>securityCode</attribute>
						<attribute>mailContactUser</attribute>
						<attribute>securityLabel_EN</attribute>
						<attribute>securityLabel_FR</attribute>
					</popupAttributes>
				<search>
					<actions/>
					<allowExport>false</allowExport>
					<columns>
						<column>
							<attribute>true</attribute>
							<dataKey>securityCode</dataKey>
							<dataType>string</dataType>
							<dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
							<ellipsis>false</ellipsis>
							<hidden>false</hidden>
							<sortAs>ALPHA</sortAs>
							<sortDirection>ASC</sortDirection>
							<sortable>true</sortable>
							<sorted>true</sorted>
							<type>general</type>
						</column>
						<column>
							<attribute>true</attribute>
							<dataKey>securityLabel_EN</dataKey>
							<dataType>string</dataType>
							<dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
							<ellipsis>false</ellipsis>
							<hidden>false</hidden>
							<sortAs>ALPHA</sortAs>
							<sortDirection>ASC</sortDirection>
							<sortable>false</sortable>
							<sorted>false</sorted>
							<type>general</type>
						</column>
						<column>
							<attribute>true</attribute>
							<dataKey>securityLabel_FR</dataKey>
							<dataType>string</dataType>
							<dateFormat>DAY_MONTH_YEAR_LONG</dateFormat>
							<ellipsis>false</ellipsis>
							<hidden>false</hidden>
							<sortAs>ALPHA</sortAs>
							<sortDirection>ASC</sortDirection>
							<sortable>false</sortable>
							<sorted>false</sorted>
							<type>general</type>
						</column>
					</columns>
					<rowClickActions/>
					<additionalSearchAttributes/>
					<displayFrozenOperators>true</displayFrozenOperators>
					<frozen>NO</frozen>
					<modes>
						<mode>MULTICRITERIA</mode>
						<mode>SIMPLE</mode>
					</modes>
					<objectReferences/>
					<searchExpression>
						<search:And>
							<search:Prop op="EQUALS_LIKE" name="securityCode"/>
							<search:Prop op="CONTAINS_LIKE" name="securityLabel"/>
							<search:Prop op="EQUALS" name="type"/>
						</search:And>
					</searchExpression>
				</search>
				<displayPopup>true</displayPopup>
				<scope type="RULE" objectKind="ORGANIZATION" xsi:type="ctd:DynamicObjectScopeType">
					<searchExpression/>
					<rule>
						<script><![CDATA[
def entities1 = expr {} as SearchExpression
def entities2 = ~ expr {} as SearchExpression
def searchExpression = expr { status.eq('NORMAL') }

OBJECT.roles.findAll { it.role == 'R20-ASL' && it.status == RoleAssignmentStatus.ASSIGNED }
    .each { r -> entities1 = expr { entities1 & not(id.belowOrEquals(r.dimensions.roleStructure as String)) } }

if (SUBJECT.rights.any { it.name in ["adm.R20.PFA", "adm.R20.POA"] }) {
// renvoyer toutes les entités sur lesquelles le user n'est pas déjà ASL
    if (entities1 == expr {}) {
        return searchExpression
    } else {
        return expr { searchExpression & entities1 }
    }
}

SUBJECT.rights.findAll { it.name == "adm.R20.STRUCTURE_DOMAIN_MANAGEMENT" }
    .each { r -> entities2 = expr { entities2 | id.belowOrEquals(r.dimensions.structure as String) } }
SUBJECT.rights.findAll { it.name == "adm.R20.STRUCTURE_SCOPE_MANAGEMENT" }
    .each { r -> if (r.dimensions.structure) { entities2 = expr {entities2 | id.belowOrEquals(r.dimensions.structure as String) } } }
    
// renvoyer toutes les entités sur lesquelles le user n'est pas déjà ASL et qui sont dans le périmètre du domain ou du scope
if (entities1 == expr {}) {
    return expr { searchExpression & entities2 }
} else {
    return expr { searchExpression & entities1 & entities2 }
}
							]]></script>
						</rule>
						<objectTypes>
							<objectType>zone</objectType>
							<objectType>securityNode</objectType>
							<objectType>department</objectType>
						</objectTypes>
					</scope>
				</config>
			</editWidget>
		</editor>
		<label></label>
		<lockedInUi>false</lockedInUi>
		<mode>READ_WRITE</mode>
		<multiValued>true</multiValued>
	</config>
	<fieldId>structuresToAdd</fieldId>
</widget>

Read Next

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.