I'm still getting the same as Jakob: sheet: <fieldset class="repeating_example">
<input name="attr_name" type="text"/>
<input name="attr_default_text" type="hidden" value="somedefault"/>
<input name="attr_check" style="display:none;" type="checkbox" value="1"/>
<input name="attr_checked" style="display:none;" type="checkbox" value="1" checked/>
<input type="text" name="attr_checkcopy" value="@{check}" disabled />
<input type="text" name="attr_dummy" value="@{checked}" disabled />
</fieldset>
<br/>
Check me:<input name="attr_non_repeating_checkbox" type="checkbox" value="1" />
<script type="text/worker">
on('change:repeating_example:name', function (eventInfo) {
console.log(' received input: event: '+ eventInfo.sourceAttribute+', type: '+eventInfo.sourceType);
getAttrs(['repeating_example_name','repeating_example_check','repeating_example_checked','repeating_example_default_text'],function(v1){
var id='',strs;
strs = eventInfo.sourceAttribute.split('_');
if (strs && _.size(strs) >= 3) {
id = strs[2];
}
console.log('################## without specifying ID ####################');
console.log(v1.repeating_example_name)
console.log(v1.repeating_example_check);
console.log(v1.repeating_example_checked);
console.log(v1.repeating_example_default_text);
getAttrs(['repeating_example_'+id+'_name','repeating_example_'+id+'_check','repeating_example_'+id+'_checked','repeating_example_'+id+'_default_text'],function(v2){
console.log('======================== specify ID =========================');
console.log(v2['repeating_example_'+id+'_name'])
console.log(v2['repeating_example_'+id+'_check']);
console.log(v2['repeating_example_'+id+'_checked']);
console.log(v2['repeating_example_'+id+'_default_text']);
});
});
getSectionIDs("repeating_example", function(idarray) {
var attrs=[];
_.each(idarray, function(currentID, i) {
attrs.push("repeating_example_" + currentID + "_name");
attrs.push("repeating_example_" + currentID + "_check");
attrs.push("repeating_example_" + currentID + "_checked");
attrs.push("repeating_example_" + currentID + "_default_text");
});
_.each(idarray, function(currentID, i) {
getAttrs(attrs, function(v) {
console.log('xxxxxxxxxxxxxxxxxxxxxxxxx ALL ROWS xxxxxxxxxxxxxxxxxxxxxxxxx');
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_name"]);
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_check"]);
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_checked"]);
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_default_text"]);
});
});
});
});
on('change:non_repeating_checkbox',function(eventInfo){
console.log(' received input: event: '+ eventInfo.sourceAttribute+', type: '+eventInfo.sourceType);
getSectionIDs("repeating_example", function(idarray) {
var attrs=[];
_.each(idarray, function(currentID, i) {
attrs.push("repeating_example_" + currentID + "_name");
attrs.push("repeating_example_" + currentID + "_check");
attrs.push("repeating_example_" + currentID + "_checked");
attrs.push("repeating_example_" + currentID + "_default_text");
});
_.each(idarray, function(currentID, i) {
getAttrs(attrs, function(v) {
console.log('zzzzzzzzzzzzzzzzzz ALL ROWS FROM CHECKBOX OUTSIDE FIELDSET xzzzzzzzzzzzzzzzzzzzzzz');
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_name"]);
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_check"]);
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_checked"]);
console.log(currentID + ': '+ v["repeating_example_" + currentID + "_default_text"]);
});
});
});
});
</script>
and the results when I add a row , and set name to "test one": ################## without specifying ID ####################
VM30:11 test one
VM30:12 0
VM30:13 1
VM30:14 somedefault
VM30:16 ======================== specify ID =========================
VM30:17 test one
VM30:18 undefined
VM30:19 undefined
VM30:20 undefined
VM30:34 xxxxxxxxxxxxxxxxxxxxxxxxx ALL ROWS xxxxxxxxxxxxxxxxxxxxxxxxx
VM30:35 -ksex5dlfwokmp0gtra0: test one
VM30:36 -ksex5dlfwokmp0gtra0: undefined
VM30:37 -ksex5dlfwokmp0gtra0: undefined
VM30:38 -ksex5dlfwokmp0gtra0: undefined
when adding a second row with name "test two": ################## without specifying ID ####################
VM30:11 test two
VM30:12 0
VM30:13 1
VM30:14 somedefault
VM30:16 ======================== specify ID =========================
VM30:17 test two
VM30:18 undefined
VM30:19 undefined
VM30:20 undefined
VM30:34 xxxxxxxxxxxxxxxxxxxxxxxxx ALL ROWS xxxxxxxxxxxxxxxxxxxxxxxxx
VM30:35 -ksex5dlfwokmp0gtra0: test one
VM30:36 -ksex5dlfwokmp0gtra0: undefined
VM30:37 -ksex5dlfwokmp0gtra0: undefined
VM30:38 -ksex5dlfwokmp0gtra0: undefined
VM30:34 xxxxxxxxxxxxxxxxxxxxxxxxx ALL ROWS xxxxxxxxxxxxxxxxxxxxxxxxx
VM30:35 -ksexttvzb4mff0c4onf: test two
VM30:36 -ksexttvzb4mff0c4onf: undefined
VM30:37 -ksexttvzb4mff0c4onf: undefined
VM30:38 -ksexttvzb4mff0c4onf: undefined
I tried seeing if behavior changes when the event comes from outside the fieldset but its the same: zzzzzzzzzzzzzzzzzz ALL ROWS FROM CHECKBOX OUTSIDE FIELDSET xzzzzzzzzzzzzzzzzzzzzzz
VM30:15 -ksex5dlfwokmp0gtra0: test one
VM30:16 -ksex5dlfwokmp0gtra0: undefined
VM30:17 -ksex5dlfwokmp0gtra0: undefined
VM30:18 -ksex5dlfwokmp0gtra0: undefined
VM30:14 zzzzzzzzzzzzzzzzzz ALL ROWS FROM CHECKBOX OUTSIDE FIELDSET xzzzzzzzzzzzzzzzzzzzzzz
VM30:15 -ksexttvzb4mff0c4onf: test three
VM30:16 -ksexttvzb4mff0c4onf: undefined
VM30:17 -ksexttvzb4mff0c4onf: undefined
VM30:18 -ksexttvzb4mff0c4onf: undefined