Hi there.
My app currently displays numerous records from the database.
My QUESTION is: how do I add a button that will let me "favourite" a record to save as a favourite record.
So for example I want to be able to load the app and click a star next to a record to save it as a "favourite".
Kind Regards
Please,
check this video: Demo: Creating a new pattern - 5-star rating
Hello Shaan Rashid
Are you doing that in web (traditional or reactive?) or mobile?
Miguel sent a video with an example of implementation in screen (mobile). You also need to add some logic to save it in the database. You need to save a record associated to userId.
If you need I can show an example to do it on database entity.
BR,
Luis
LuÃs Cardoso wrote:
Hi Luis I'm doing this in a mobile app.
Yes please I'd appreciate it if you show me the example please.
Hi!
You can see an example here:
https://luiscardosokinetit.outsystemscloud.com/PreviewInDevices/?IsMobilePreview=True&DeviceName=Smartphone&URL=/Favorites/HomePage
Send also the oml in attchment.
Hope it helps.
Shaan Rashid wrote:
Thank you Luis.
Another question please if you don't mind.
For the next time a user logs in how would you get the app to remember which records the user selected as their favourites from the last time they logged in?
Hello!
In my example I am not loading the favorites on OnReady event of the screen. I added that and now is working.
Please test it again. also, I am sending the new version of oml file in attchament.
Also why is this giving me errors? (picture attached).
Anyone know how I can fix these errors?
Regards
Can you please share your query? I think you are assing the wrong name of entity or atribute
Hi Luis
Here's my OML file with my latest attempt at creating the favourite button using your example.
As you can see I can display the star icons but when I click on the star it doesn't work.
Please let me know what the issues are.
Shaan
P.S if it asks you to log in then use:
Username: Find_Fujitsu_User
Password: qwerty
Hello Shaan,
You have some issues on your code... starting from data model: You need to create a new entity to store Favorites, you can't use the entity FJLocation.
After, you need to put the "star" icons inside the Listitem in the screen, you need to assing variable Response to List and you have the call of actions wrong.. you are calling NotFavouriteOnClick where you should call FavouriteOnClick and vice-versa..
I solved some os this issues but is not working correct yet... You need to solve first the datamodel and after that follow my example (step by step)
Maybe it helps to create a new screen to do this again.
Also a quick note: You send me the oml file and for testing I will deploy it on my personal enviornment, so I will not need your credentials :)
Thanks Luis
Upon loading this file I get this message what should I do?
At this stage you have no idea of what you're doing so you follow the tips of the tool and you refresh the dependencies.
The right thing to do is usually Refresh All. When you know what you're doing, you can decide when and what to refresh.