Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Radio Button in List

Hi,

I have a list which is populated from an Appery database service. I wish to include a yes/no radio button on each of the list items that is independent of all the other list items radio buttons. Is this possible? if not can you suggest an alternative method of achieving this. I have tried a toggle button but this looses the label values when used in the list view.

Regards,
Joe

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Radio Button in List

Hi Joe - working on it. We'll update.

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

Radio Button in List

If you are asking whether you can insert a radio button inside the list -- the answer is yes. Was your question about something else?

Image

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Radio Button in List

Hi Max,

My list is exactly as yours with the addition of toggle switch which I also have problems with, the on and off label text have been changed in the designer but this does not populate to the form. when changing a radio button on one list item all the other radio buttons on other items are changed to the same value. I have shared the app to support.

regards,
Joe

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

Radio Button in List

I'm not 100% sure I understand what happens.. could you post screen shots?

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Radio Button in List

Image

The labels on the toggle switch are set to Yes/ No on the settings tab. But when the application launches the labels read On/OFF.

Image

Yes is selected on the the screen shot above, but when No is selected on the second list item the first list item reverts to unselected.

Image

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

Radio Button in List

Hello!

But when the application launches the labels read On/OFF-- it's a bug. This should help https://getsatisfaction.com/apperyio/...

when No is selected on the second list item the first list item reverts to unselected -- the problem is that all radio buttons have the same name. To change that on service success (service where you map results) add the following code:
code$('[name=mobileradiogroupName]').each(function () {
var $this = $(this);
name = $this.attr('name');
if (name) {
$this.attr('name', name + $this.attr('_idx'));
}
});/code
where mobileradiogroupName - name of mobileradiogroup

But if you've added any actions on mobileradiogroup - they won't work. You would need to bind them to new names. For example to bind event "Value change" mobileradiogroup on service success event add the following code:
code$('input[name^="mobileradiogroupName"]').die().live({
change: function() {
//here is your code
}
});/code
where mobileradiogroupName - mobileradiogroup name.
Also if somewhere in your programm you used selector [name=mobileradiogroupName] you can't use it now. For example in function on "Value change" event described above you can use "this". In this variable you pass element where event occured. For example use code $(this).val()/code to get value of mobileradiogroup which was changed.

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Radio Button in List

Hi Marina, Thanks for your code I managed to get the toggle switch to behave as required.

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Radio Button in List

Hi Marina,

Everything is working great apart from the list is losing its custom styling. In more properties for the optiongroup I add settings which work on the developer but not on the exported application.

Image

I would also like to style the list like a banner and have attempted applying custom css but have not been successful could you advise me on how to achieve this please.

Regards,
Joe

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

Radio Button in List

Hi Joe,

On what device do you test exported app?

As for Mobile List stilization - you can create create theme here: http://jquerymobile.com/themeroller/i...

Return to “Issues”