Hi,

I'm fairly new to outsystems, so I might be missing something here.

What i would like to achieve is a reusable button which i can then assign a different action to depending on where i use it.

The setup is pretty straightforward, I'm talking to an external api and am calling a function onto a record in that api.

eg  PUT `/members/{id}/promote`

In my commons folder I've added a webblock containing the button, This would be the generic part, the button always looks the same, always takes the id an an input parameter.

No i would like to reuse this in multiple screens.
eg: in a table listing members, on the detail view of that member, etc

However on the table screen i would like to perform am ajax refresh after clicking and on the detail view i would like to navigate away from the screen.

In my first approach every screen had it's own button but this ofc, is rather hard to keep in sync, label having to be updated on multiple views etc.

So my question: What would be the best practice way to approach this?

Solution

At the end of the button action logic depending on the OutSystems version:

->Before 11 : send a notify;

->11: trigger an event.

On the pages where the button is needed you would then have an handler to deal with the notify/event and do the page specific actions.

Solution

Francisco Sampaio wrote:

At the end of the button action logic depending on the OutSystems version:

->Before 11 : send a notify;

->11: trigger an event.

On the pages where the button is needed you would then have an handler to deal with the notify/event and do the page specific actions.

Thnx, that seems to do the trick. :)