Select

Properties of Select

  1. Id - unique identifier of the control
  2. Actions on Change - a place to inject a custom code or action in the event that the value changes. A common application of this is calling a Javascript Function.
  3. Bound Field - the Field Name that links the Control to the Data Model.
  4. GridData(LMS) - control's column values for Large, Medium and Small screens. Please refer to GridData for further details
  5. Style Class - assign a predefined SAPUI5 CSS or a CSS class defined in the CSS of the App
  6. Enabled - set a boolean value or a variable with type boolean from the Model to control the enable property
  7. Visible - set a boolean value or a variable with type boolean from the Model to control the visibility property
  8. Filter - filter settings to be passed to the entity set maintained in the Select Template
  9. Mandatory - set a boolean value or a variable with type boolean from the Model to control the mandatory property
  10. Advanced - properties of the control not available in the above list can be added here. 

    Setting Additional Properties provides further information about the Advanced property

Properties of Select Template

  1. Key - key indicator or variable from the entity set
  2. Text - Key description to be displayed from the entity set
  3. Model - oData model to be used
  4. Entity Set - Entity set to be called. Leave this empty if the Model selected is "configuration"
  5. Definition - only applicable if the Model selected is "configuration". This is define explicitly the values that will be available for selection.
     

Properties of Individual Items

  1. Id - unique identifier of the control
  2. Key - key indicator or variable
  3. Text - Key description to be displayed
  4. Text Direction - options are RTL (Right to Left) or LTR (Left to Right)
  5. Enabled - set a boolean value or a variable with type boolean from the Model to control the enable property

Dependent Select Controls

In some cases you may have a Select control that uses a filter based on another field in the data model.  When that value changes, you need to execute a function that will refresh the filter based on that value.

Select Controls Outside of Tables

  1. First you have to get a reference to the Select control you want to refresh.

    var ctrlSelect = getControl('selMyDropDown');
  2. Then you need to tell the Forms Controller to apply the Select filters

    thisFormsController.applySelectFilters(ctrlSelect);

Select Controls Inside of Tables

When you need to refresh the filters for a Select control within a table, you have the option of either using the action RebindSelectInTableLine or through JavaScript.

Action Method:

The Parameter is the index of the control in the Table.  Note that the index is zero based so the first control in the row will have an Index of 0.


JavaScript Method:

A JavaScript function should be written that takes in the evt parameter as shown in the sample below.  That will ensure the function knows which table it is dealing with.  It also requires an Index to be passed in for the control.

function rebindSelect(evt){
    var iSelectPosition = 2;
    rebindSelectInTableLine(evt, iSelectPosition);
}

Step-by-step guide

How to add a Select

  1. Right click on a Form Element and select Add Select

  2. The Select and Select Template controls have been added
  3. Individual items can also be added into the Select Control by doing a Right click on the Select and select Add Individual Items