Hello,
I’m coming for advice because I cannot figure out how to get the exact behavior I want for my app.
I’m trying to get text search results similar to most search engines, as a list of results with pagination controls at the end, I got it working but when I use those pagination controls the new results are displayed in the main container, not the one it originated in.
- I have three containers, search container, params container and result container.
- I’m using a first callback function to build the elasticsearch query using the controls in search container and params container.
- Then a second function defines every navigation scenario
- “first” will just run the query and retrieve the scrolling id.
- “next” will collect new results from the scrolling query (each subsequent scrolling id is stored in a list to be able to go back).
- “prec” will replay a previous scrolling.
- A third function handles the display of the results and navigation buttons, which re-uses the previous function as callbacks for those buttons.
So these two functions are calling one another recursively which means I can’t have “with …:” statements inside or I will setIn errors from a container trying to be found amongst its own children. There can be only one in the first callback function.
my issue is that when I’m using navigation buttons, and enters the recursivity, I’m not in the context of that first function, and thus not in my initial “with results_container:” anymore, so the new results are popping anywhere, usually on the top of the page.
Is there any good way to do this ?
edit: I can’t use a fragment because there is a popover associated to each result