clint-tseng/odkbuild — Issue #9: [Fix] Looped and Display On One Screen
Author: jluis859
Created: 2011-12-09 23:08:53+00:00
State: open

I had troubles with this, because it wasnt working when both were selected, it only worked Looped and not with Display On One Screen.
One solution that I found was putting a group inside another group with different options and it works, but I made my custom solution and with this you can only use one group and have the two options.

Based in

The code goes in public/javascripts/data.js
I changed this:
// field-list
if (control.fieldList === true)
{
bodyTag.attrs.appearance = 'field-list';
}

For this:
// field-list
if (control.fieldList === true)
{
//Fix field list + loop
if(control.loop === true){
var loopBodyTag2 = {
name: 'group',
attrs: {},
children: []
};
bodyTag.children.push(loopBodyTag2);
bodyTag = loopBodyTag2;
}
bodyTag.attrs.appearance = 'field-list';
}

And now it works very well without causing troubles.

Greetings.