Ticket #250 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

selection-control with valueTemplate which contains value '0'

Reported by: sdm Owned by: mpo
Priority: critical Milestone: 0.4
Component: modules/kauri-forms Version: trunk
Keywords: Cc:

Description

This is the selection-control configuration:

'abcId' :{

base: 'integer',

control: 'abc-control',

'+validators' : { 'required' : {message: 'Required!'}}

}

...

'abc-control': {

base: 'selection-control',

options : {

uri: '${publicUri('service:/router')}/abc/all',

valueTemplate: '{id}',

labelTemplate: '{label}',

nullable: true,

"null-text": '--- Choose abc ---'

}

}

If the JSON result from the server is something like this:
[{"id":0,"label": "A"}, {"id":1,"label": "B"}]
which contains an id '0', the following HTML gets rendered:

<option value="">A</option> instead of <option value="0">A</option>

'abcId' contains a required field validator, and the value of A is empty, so you can't select A because then the required field validator shows up, indicating that you didn't select a value.

Change History

comment:1 Changed 3 years ago by jgou

  • Priority changed from minor to critical

comment:2 Changed 3 years ago by freya

  • Status changed from new to closed
  • Resolution set to fixed

solved in r1460

Note: See TracTickets for help on using tickets.