So I have this form, which pushes a subform for gathering mailing address info (I've simplified the JSON definition of the form here for clarity - I did test this version, and it still breaks):
{
"grouped": true,
"title": "Add",
"sections": [
{ "elements":[
{ "type":"QLabelElement", "title":"Location",
"sections": [
{
"elements": [ { "type":"QEntryElement", "title":"Address line 1","placeholder":"", "bind":"textValue:Address1", "key":"Address1"},
{ "type":"QEntryElement", "title":"Address line 2","placeholder":"optional", "bind":"textValue:Address2", "key":"Address2"},
{ "type":"QEntryElement", "title":"City","placeholder":"", "bind":"textValue:City", "key":"City"},
{ "type":"QEntryElement", "title":"State/Province","placeholder":"", "bind":"textValue:StateProvRegion", "key":"Prov"},
{ "type":"QEntryElement", "title":"ZIP/Postal Code","placeholder":"", "bind":"textValue:PostalCode", "key":"PCode"},
{ "type":"QPickerElement", "title":"Country", "items":[["Czech Republic", "Germany", "United Kingdom"]], "value":"Czech Republic"}
]
}]
}
]
}
]
}
I have an NSMutableDictionary with a bunch of data in it to pre-pop all the fields in the form, including those in the address. The code to populate the dictionary and show the dialog looks like this (again, super-simplified, but this still breaks):
NSMutableDictionary *dataDict = [[NSMutableDictionary alloc] init];
[dataDict setObject:@"123 Maple Street" forKey:@"Address1"];
QRootElement *root = [[QRootElement alloc] initWithJSONFile:@"addjobform" andData:dataDict];
UINavigationController *navigation = [QuickDialogController controllerWithNavigationForRoot:root];
[self presentModalViewController:navigation animated:YES];
If I run this code with the JSON above, the dialog comes up fine, but the fields don't populate. BUT - if I move the address elements out of the nested subform back up to the first level - they populate (in this case, Address1 comes up with 123 Maple Street pre-popped). In other words, this JSON binds correctly while the previous version above doesn't:
{
"grouped": true,
"title": "Add",
"sections": [{
"elements": [ { "type":"QEntryElement", "title":"Address line 1","placeholder":"", "bind":"textValue:Address1", "key":"Address1"},
{ "type":"QEntryElement", "title":"Address line 2","placeholder":"optional", "bind":"textValue:Address2", "key":"Address2"},
{ "type":"QEntryElement", "title":"City","placeholder":"", "bind":"textValue:City", "key":"City"},
{ "type":"QEntryElement", "title":"State/Province","placeholder":"", "bind":"textValue:StateProvRegion", "key":"Prov"},
{ "type":"QEntryElement", "title":"ZIP/Postal Code","placeholder":"", "bind":"textValue:PostalCode", "key":"PCode"},
{ "type":"QPickerElement", "title":"Country", "items":[["Czech Republic", "Germany", "United Kingdom"]], "value":"Czech Republic"}
]
}
]
}
Why do the bindings work at the first level and not nested under the Location label? The form push works as advertised, but the binding is broken - is there something special I have to be doing? I've searched far and wide and not found an answer or an example. I tried this code in a stripped down single-view app that does nothing but the above, and it still breaks - so it's not an interaction with my other code either. Per the author of QuickDialog, subform nesting is supposed to be supported (https://github.com/escoz/QuickDialog/issues/226) Any thoughts? Thanks!