I would like to create a menu of items that will redirect you to its corresponding URL when clicked. I can easily do this using Link Widget.
Twist:
The team wants a centralize entity for this URLs, What I did is create a client action for the link widget.
For this client action, I want its input parameter to be automated. It fetches the Link Widget ID then, aggregate the entity to feed back the corresponding URL.
Now, I'm STUCK in fetching the Link Widget ID. Can you help me? or is there any easier way to do this
Thanks for the help
Hi,
For OutSystems to be able to provide you a widget id, You need to to set the Name propety of the widget.
Only widgets with a Name.propery set are shown.
Regards,
Daniel
Hi Danie,
I have already set the name of my link widget to "Learning". What command should I use to get this Link widget ID?
You can select them in the expression editor. If you need the Id in a javascript node in a client action, then you should pass the value into the Javascript node as an input parameter.
Hi @Vince Kyle Ramos ,
I think you need to turn around how you look at it.
If they want you to set up a database with url's instead of hardcoding them, I think they also want you to not hardcode options, but let this entity define what items you should be showing in your menu.
So the starting point is the entity, not some link with some name. In other words, to for example produce a list of menu items, you would probably start with fetching them from the entity, and the entity would have as minimal attributes maybe name and url.
You just put a list of links in your ui, showing the name as content, and going to the url when clicked.
The datamodel can need extra attributes to finetune for what users or on what screens what exact links should be shown, stuff like that.
So it is not a matter of you trying to find the corresponding entity record for some link, the link itself gets drawn from the entity, so once it is in the UI, you know the entity record.
Dorine
PS. even if you don't do it like this, I wouldn't wait until the user clicks a link to go and fetch the url, for user experience reasons.
Hi @Vince Kyle Ramos,
The name of your link widget is the widget Id, that's one of the reason the name of every widget is unique.
I hope this helps,
Ojasvi Sharma