Page 1 of 2

Create Dynamic Tick List

Posted: Wed Feb 03, 2016 2:20 pm
by Joe Bohen

Hi, I am attempting to create a dynamic list of Radio questions and answers each question has a 'True' and 'False' option displayed as answers. My aim is to create a list from a database service response but the styling is being lost and the buttons don't work as a group. The trial code I am using is here will you take a look and advise me on this?

var allItems = '';
for (var i=0; i< 4; i++){
var inp ='Inputtxt' + i ;
allItems += 'a rel="nofollow"/aNo faultsFault
Item ' + i + ' text or description
';
}
Appery("checklist").empty().append(allItems);
console.log(allItems);


Create Dynamic Tick List

Posted: Thu Feb 04, 2016 10:08 am
by Serhii Kulibaba

Hello Joe,

It is better to save all values for radio buttons to the storage array and use that array in the mapping: https://devcenter.appery.io/documenta...


Create Dynamic Tick List

Posted: Fri Feb 05, 2016 4:32 pm
by Joe Bohen

Hi Sergiy,

I am saving the values to a local webSQL table and querying the table to get the results then looping through these to build the list of questions. I can't see anywhere in the link that shows mapping to an array of objects do you have an example? It would be easy enough to place the results of the query into an array.


Create Dynamic Tick List

Posted: Sat Feb 06, 2016 12:45 pm
by Joe Bohen

Hi Sergie,

I have managed to work this out with the aid of the forum so please ignore my last comment. But I have three remaining issues:

1) how do I map the value of of the returned value to a string?

If in the service response I place alert(data[0]['Question']); I get the expected value returned. My mapping returns [object][object] in a mapped label.

Image

2) This is probably down to lack of styling! I have a radio button group within a grid component the buttons separate and appear one above the other!

3) How would I map an Id to each of the groups that would show which of the buttons had been selected.


Create Dynamic Tick List

Posted: Sat Feb 06, 2016 7:17 pm
by Serhii Kulibaba

Please add there: http://prntscr.com/9zuxjj JS below:

return value.Question;


Create Dynamic Tick List

Posted: Sun Feb 07, 2016 11:09 am
by Joe Bohen

Hi Sergiy,

Thanks for your reply, could you also help me with this issue, grouped buttons that where displaying correctly are now miss-aligned as in the image below! no change has been made to the css!

Image


Create Dynamic Tick List

Posted: Sun Feb 07, 2016 6:12 pm
by Serhii Kulibaba

It seems to width of it's parent component is not enought to these grouped buttons


Create Dynamic Tick List

Posted: Mon Feb 08, 2016 10:13 am
by Joe Bohen

Hi I have shared a test app with support that shows the problem. Run the app 'popuptest' and then click run service which populates the data from a generic service and adds some grouped buttons to the page. The buttons lose there ability to show a different colour when selected (They appear not to be selectable!) and the shape is lost in every group with the buttons all miss-aligned. Will you have a look at this and let me know if there is a solution or work around to this please.


Create Dynamic Tick List

Posted: Mon Feb 08, 2016 7:02 pm
by Serhii Kulibaba

Could you please provide us it's name and with exact steps to reproduce this issue/problem?


Create Dynamic Tick List

Posted: Mon Feb 08, 2016 10:48 pm
by Joe Bohen

Hi Sergiy, The app is called 'popuptest' if you run the app the 'vehicle_check_page' will be loaded if you then click 'Run Service' the generic service will be run and the mapping will be populated.. There is only one data source on the page 'getCheckDataService' the generic service.