Page 1 of 1

using user choice to build new list

Posted: Thu Aug 01, 2013 12:25 pm
by Fabian Unruh

i'm trying load a second list (villages) from my db based on the selection of the first list (countries).

how can this be done? am i right if i store a local variable based on the user selection to load the right list with the query_service (where column_name = variable?)? are there any examples / tutorials?

i'd really appreciate any ideas.


using user choice to build new list

Posted: Thu Aug 01, 2013 1:24 pm
by Maryna Brodina

Hello! In mapping to localStorage in request parameter "where" add the following JS:
codereturn '{"columnName": ' + value + '}';/code
where columnName - column name you use to selec
More examples here http://docs.appery.io/documentation/b...


using user choice to build new list

Posted: Fri Aug 02, 2013 10:53 am
by Fabian Unruh

thanks for the reply.

I inserted the JS into the where clause into the local storage mapping. It only returns an empty list.

Here's what I do:

Page 1: A select box is displayed. Event: On value change I store the local storage variable (name: zipcodeuser value: 8142 (static for testing), then i navigate to the next page.

on Page 2: i have another select box where i map the local variable to the Where clause with JS: return '{"ZIPCode": ' + value + '}'

what am I doing wrong?

I also recognized, that the second page only loads when I make a selection for the second time. the first time it always reloads page 1.

thanks so much for your support.


using user choice to build new list

Posted: Fri Aug 02, 2013 12:57 pm
by Maryna Brodina

See my reply here https://getsatisfaction.com/apperyio/.... Let's continue there.