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:
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.
When user click a listItem, I take the categoryId (hidden label) onto a localStorage variable.
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!