UIOMatic icon indicating copy to clipboard operation
UIOMatic copied to clipboard

Update item not able to select the selected value for dropdown field

Open merly-cortez opened this issue 2 years ago • 1 comments

Hi,

Been searching the documentation and I believe have set up my column correctly. But opening the Update Item form doesn't select the selected item in the dropdown correctly. Please see as in attached.

Here's my column definition: [UIOMaticListViewField(Name = "Suburb", View = UIOMatic.Constants.FieldViews.Label)] [UIOMaticField(Name = "Suburb", Description = "Select the suburb", View = UIOMatic.Constants.FieldEditors.Dropdown, Config = "{'typeAlias': 'ekeSuburb', 'valueColumn': 'Id', 'sortColumn': 'Name','textTemplate' : '{{Name}}' }")] public int SuburbId { get; set; }

Here's my type definition: [UIOMatic("ekeSuburb", "Suburbs", "Suburb", FolderIcon = "icon-location-nearby", ItemIcon = "icon-location-nearby", RenderType = UIOMatic.Enums.UIOMaticRenderType.List)] [TableName("ekeSuburb")] public class Suburb {

    [PrimaryKeyColumn(AutoIncrement = true)]
    public int Id { get; set; }

    [Required]
    [UIOMaticListViewField]
    [UIOMaticField(Name = "Name", Description = "Enter the name of the suburb")]
    public string Name { get; set; }
}

image

merly-cortez avatar Sep 22 '21 02:09 merly-cortez

@merly-cortez I was having the same issue. I adjusted the dropdown view and changed value to ng-value around the ng-repeat. My selected options are now showing up just fine.

<div ng-controller="UIOMatic.FieldEditors.Dropdown">
    <select name="select" id="" ng-model="property.value">
        <option value="">---Please select---</option>
        <option ng-repeat="item in items track by item.value" ng-value="{{item.value}}">{{item.text}}</option>
    </select>
</div>

toliphant avatar Jan 17 '22 23:01 toliphant