Hi,
We have requirement where we have two components
1.Search Form (which will have the Search Form and Google Map)
2.Search Results component
"Search Form" and "Search Results" are being developed as two different component because team wanted to re use the "Search Form"
The Ajax call to service goes out from Search From component, team has proposed the RxJS solution to dynamically communicate data between Search From and Search Results component. So, whenever there is new search RxJS has to dynamically update the Search Results component.
If any body has developed this kind of approach, can you advice on this.
Thanks,
Madhu
Views
Replies
Total Likes
Hi Madhu,
Why don't you submit form instead making Ajax call on search button click as a Post request and action page would be your search table/result page. This way you can communicate between components.
If you have both search and search result component on both pages, then you can put a condition of search result component to identify initialled and search load.
Thanks
Arun
Views
Replies
Total Likes
Arun is correct - Ajax is standard way - with a Sling Servlet - to do this type of use case. I have never seen any RxJS solution example with AEM.
Views
Replies
Total Likes
Hi Arun,
Thanks for your reply,
There is only one page i.e "search page" where both components present, so on click of "Search" button user stays on same page but we would required to refresh always search results component , that's why we have to do Ajax call rather form submission.
So we have to add RxJS observer to trigger the change and refresh the search results component.
Thanks,
Madhu
Views
Replies
Total Likes
Then you can do a normal Ajax call to service and update the search result section of content of search.
There is no need to established special relationship between components.
you can specify a unique id to result component wrapper and based on that you can update the content.
Views
Replies
Total Likes
Thanks Arun for your suggestions
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies