Page 1 of 1

Recursive call and list binding

Posted: Tue Sep 17, 2013 5:35 pm
by Eduardo Ramos

Hello,

I have a behavior I would like to implement:

I have a service that gets an array of categories, which I bind to a mobile list. All of those categories have subcategories.

Currently, this is what I'm doing:

  1. Invoking a GetCategoriesService where I get all of the categories and bind it to a List control. I'm saving the category id on a hidden label on each listItem.

  2. When user click a listItem, I take the categoryId (hidden label) onto a localStorage variable.

  3. Navigate to another page where I Invoke the same service, but with a where condition passing the categoryId to get all the subcategories that belong to that category user clicked.

    This works OK, but I'm not using recursivity. This approach limits the depth of the Categories tree to 2 sublevels (or 3 or 4 or 5, but having to create multiple pages).

    Do you know what's the best approach to implement recursivity: Having one single Categories page, and every time user clicks a category rebind the list control with all subcategories and so on.

    Thanks!


Recursive call and list binding

Posted: Tue Sep 17, 2013 6:01 pm
by Eduardo Ramos

Scratch my question:

My answer was already there. Instead of navigating to a new page I just need to call the same service and voila!

I @%$% love appery.io!


Recursive call and list binding

Posted: Tue Sep 17, 2013 6:05 pm
by Maryna Brodina

Hi, thanks for update! Glad it's working now!