Zaki Mohzani
Posts: 0
Joined: Thu Mar 28, 2013 2:34 pm

How to map selected radio button's text to backend service request

I have a radio list and a button to submit the result to the backend service.

So the code does the following:

  1. Populate the radio list from backend service

  2. User selects the radio button of his choice

  3. Clicks on a button

  4. a 'create service' runs to submit the selection to the backend service.

    However, instead of the selected radio button's text being sent, 'Item 1' shows up on the collection.

    How can I map the selected radio's text instead of whatever is being sent.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to map selected radio button's text to backend service request

Hi, working on it. I'll update.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to map selected radio button's text to backend service request

Please check whether you have correct mapping

Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to map selected radio button's text to backend service request

Selected property of Radio Group component keeps selected element value . We tested - it works with the mapping showing above.

Zaki Mohzani
Posts: 0
Joined: Thu Mar 28, 2013 2:34 pm

How to map selected radio button's text to backend service request

Thanks guys, that worked.

The mistake I did was to map data from the DB to the radio buttons where only the 'Text' field was assigned.

To fix it, I made sure the data from the DB also mapped to the 'Value' field.

Tom6106181
Posts: 0
Joined: Fri Aug 02, 2013 12:39 pm

How to map selected radio button's text to backend service request

And how to do it the other way around? To map the selected value from DB to the radio buttons?

in my example: I have an EDIT USER = Gender (male/female). I can not figure out how to set the correct button selected when retrieving the current "gender" from DB. Any suggestions?

-Tom

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to map selected radio button's text to backend service request

Hi Tom,

Create mapping to JavaScript variable (if you need to store the value use localStorage) and add for it JavaScript code that looks like the following:
precode
if (value == "female") {
Appery( "mobileradiobutton_female" ).setAttr("checked", "checked");
} else {
Appery( "mobileradiobutton_male" ).setAttr("checked", "checked");
}/code/pre

Return to “Issues”