Eduardo Ramos
Posts: 0
Joined: Fri Sep 06, 2013 10:20 pm

Recursive call and list binding

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!

Eduardo Ramos
Posts: 0
Joined: Fri Sep 06, 2013 10:20 pm

Recursive call and list binding

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!

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

Recursive call and list binding

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

Return to “Issues”