Hi Everyone
I am making a Movie Displaying application in which I will be able to display movies with different genres . For example ,if I want to search movies with genre "Action" , I will click on Action and all the movies having genre as Action will be displayed . But I am not getting the logic where should I use the filter for it.
I am attaching the oml . It will be helpful if anyone can help me on this
Hi Priya,
You need to add a local variable to your screen, having a data type of MovieGenre Identifier.
Second, you need to add a filter to the aggregate GetMovieDetailsByMovieGenreId, using the previously created local variable.
Finally, on every action that handles the click on a Genre, you need to set the proper value of the local variable you created, before refreshing the aggregate.
Some improvements / best practices you should take into consideration:
- Add a local variable called MaxRecords to your screen, with a default value of 10 or 20, to display only that number of records on your page
- Use the variables StartIndex and MaxRecords on the aggregate GetMovieDetailsByMovieGenreId
- Add a Pagination widget on the bottom of the Gallery widget
- Adopt a single action to handle the clicks on the Movie Genres, with an input parameter of the same data type
Hope this helps, but in all cases, I would recommend you to go through the Becoming a Reactive Web Developer Guided Path, which will help you better understand all the topics related to your question.
Best regards,
Paulo
Hi Priya Kumari,
I don't know why you are using ActionKeyword in the filter. I hope it should be removed.
Thanks,
Ramesh