Trigger Action with a "built" HTML link
Question

Hi OS Community,

I am building a tree using graphing library. In each node of the tree I define the text, image etc using HTML. In each node I also want a link which triggers a client action (the action having one parameter passed into it). What is the best way to do this. For example i want to add something similar to my node <a href=MyAction(2211)> Click me </a> where MyAction is some kind of Client Action. Can be an onclick too. 

If there was a way to reference a block (where the content of the block was a link and the block contained the client action) via HTML then that could work as well.

I look forward to your ideas,

Rob

Hi Robert,

Did you explore the option to add an event to the link and then call the Client Action? Or your use case is different?

Cheers,

António Pereira

Hi Antonio,

Yes, this is a different situation. In an expression i am writing the html manually. I'm not using the Outsystems link widget.  Something like this

Node Contents expression  = "<div class='node-title'>Title</div><div class='node-content'>Description</div><a href=myActionHere()>Click me</a>"

Where myActionHere() is, that should be the name of the client action.

Thanks for your help though :)

Rob


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.