Al Veitas
Posts: 0
Joined: Tue Mar 06, 2012 3:43 am

Populate Mobile Checkbox Group with REST response

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Populate Mobile Checkbox Group with REST response

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

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

Al Veitas
Posts: 0
Joined: Tue Mar 06, 2012 3:43 am

Populate Mobile Checkbox Group with REST response

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Populate Mobile Checkbox Group with REST response

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

Al Veitas
Posts: 0
Joined: Tue Mar 06, 2012 3:43 am

Populate Mobile Checkbox Group with REST response

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Populate Mobile Checkbox Group with REST response

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?

Al Veitas
Posts: 0
Joined: Tue Mar 06, 2012 3:43 am

Populate Mobile Checkbox Group with REST response

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Populate Mobile Checkbox Group with REST response

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

Al Veitas
Posts: 0
Joined: Tue Mar 06, 2012 3:43 am

Populate Mobile Checkbox Group with REST response

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Populate Mobile Checkbox Group with REST response

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

Return to “Issues”