2 Jan 2012 4:02 AM #1
Using square brackets in field name breaks selectfield reset
Sencha Touch 1.1.0
Tested on iOS 5.0
Ruby on Rails require field names in the following format 'model[property]', so my ST form field names use the same format:
name : 'asb[asb_type_id]',
valueField : 'id',
displayField : 'name',
store : app.stores.asbTypes
xtype : 'textareafield',
name : 'asb[description]',
label : 'Description',
maxLength : 60,
maxRows : 5
This only becomes a problem when reseting a 'selectfield' field. The following error is thrown:
"Invalid ComponentQuery selector: "]""
The error relates to the function called 'child' that is called when the selectfield attempts to reset the picker value, calling a query on something like:
The call stack is:
Picker.setValue() - Line 28589
Picker.child() - Line 25509
2 Jan 2012 6:54 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
This is because the square brackets mean something to ComponentQuery.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
2 Jan 2012 6:58 AM #3
Which is why I believe it is a bug. Unless of course W3C doesn't allow square brackets in the name attribute, my impression was that they were allowed.
27 Jan 2012 2:00 PM #4
How can this be closed?
Isn't it a legitimate bug if ComponentQuery is re tasking a legitimate character used in form names?