Page 1 of 2

Populate Mobile Checkbox Group with REST response

Posted: Mon Mar 12, 2012 8:02 pm
by Al Veitas

Hi, we have a mobile checkbox group embedded in a collapsible block and would like to iterate through the json array response and populate a checkbox's text for each json object in the response.

Attached is the current mapping we have. As you can see, "mobilecheckbox5" has custom java script which looks like:

element.text(value.name);

When testing, a list of the text appears, when uncollapsing the block, but the checkbox's are not rendered.

Any ideas?

Image


Populate Mobile Checkbox Group with REST response

Posted: Mon Mar 12, 2012 8:20 pm
by maxkatz

When using JavaScript, you need to have a return statement.

Does it work if you don't use the JavaScript?


Populate Mobile Checkbox Group with REST response

Posted: Mon Mar 12, 2012 8:26 pm
by Al Veitas

Hi Max,

As always, thanks for the quick response!

RE: Does it work if you don't use the JavaScript?

If mobilecheckbox5.Text is mapped to $.name (instead of $), then a single checkbox appears but no text is seen

Thanks,
Al


Populate Mobile Checkbox Group with REST response

Posted: Mon Mar 12, 2012 8:44 pm
by maxkatz

You need to map $ to mobilecheckbox5 and name to Text.


Populate Mobile Checkbox Group with REST response

Posted: Mon Mar 12, 2012 8:50 pm
by Al Veitas

Hi Max,

Should have mentioned that earlier and that is why we had the custom JS to begin with: once mobilecheckbox5 is mapped to $, we are unable to map name to Text (get the RED button when dragging Text over to name).

Thanks,
Al


Populate Mobile Checkbox Group with REST response

Posted: Mon Mar 12, 2012 10:28 pm
by maxkatz

It should work, I was able to map it:

Image

If still doesn't work, can you share your app with a href="mailto:support@tiggzi.com" rel="nofollow"support@tiggzi.com/a?


Populate Mobile Checkbox Group with REST response

Posted: Tue Mar 13, 2012 1:36 am
by Al Veitas

Max, looks like our mappings differ slightly. In your mapping the actual text is being mapped to a label's text, where mine was being mapped to the checkbox's text.

I added a label and was able to map as we wanted, but now when it is rendered, the text does not actually display :(

FWIW, am using FF 3.6.18

Screenshot attached Image


Populate Mobile Checkbox Group with REST response

Posted: Tue Mar 13, 2012 1:50 am
by maxkatz

Right now you need to put a Label inside, to be able to map to it.


Populate Mobile Checkbox Group with REST response

Posted: Tue Mar 13, 2012 2:03 am
by Al Veitas

Yes, we did that and the label's text is not being rendered. See screenshot from last post


Populate Mobile Checkbox Group with REST response

Posted: Tue Mar 13, 2012 2:55 am
by maxkatz

I don't see the label in your original screen shot...