PDA

View Full Version : [FIXED] [PR1] radiofield getValue



JanLoesbrock
2 Nov 2011, 12:12 AM
The getValue-methode from radiofield use the inherited getValue-methode from checkbox, so it returns only true or false and not the config.value.

Tested on Chrome 15.0.874.106 beta

kind regards
Jan

Jamie Avins
2 Nov 2011, 7:41 AM
Thank you for the report.

chaobin
18 Jan 2012, 1:05 PM
I can see the value using form.getValues() before. However after implement a store, the radiofield value turned to 'true' or 'null'? Example of console debug form.getValues() output:.


gender: true
name: "bill"
null: null
q1: true
q2: true
q3: true
q4: true
q5: null
q6: null
q7: null
q8: true
q9: nul
I am using sencha-touch-all-debug.js, I could not found any bug fixes clauses? Any newer version for the file?

chaobin
18 Jan 2012, 2:19 PM
Further reading into the sencha-touch-all-debug.js,
on line 41118:
getValue: function() {
return this._value;
},

and my debug on gender radio field has the value:


_name: "gender"
_required: false
_requiredCls: "x-field-required"
_styleHtmlCls: "x-html"
_tabIndex: -1
_ui: "radio"
_value: "m"


Therefore, the returned value should be 'm' instead of 'true'?

On my view realated code:

{ xtype: 'radiofield', name: 'gender', label: 'Male', value: 'm' }, { xtype: 'radiofield', name: 'gender', label: 'Female', value: 'f' }
Many Thanks if anyone could answer this?

chaobin
21 Jan 2012, 12:24 PM
It is pain, however have to get over it, I figured out to add a listener for the check event and set the value for the field using form model, here is the function:

doCheck: function( e){

var aValue=e._value;

var form=e.up();

form.getRecord().set(e.getName(), aValue);
}