HOWTO: Create a reusable screen action

HOWTO: Create a reusable screen action


I have a situation where there are multiple widgets on the screen and I need to AjaxRefresh just one of them. I don't know at design time which one it'll be. There could be 2 or more such widgets.

How do I create a reusable screen action where I can use an Input Parameter of type "widget."

I also have encountered scenarios where I want to pass in an Aggregate to a function, but there is no datatype for Aggregate. I can't choose "List of Records" as a parameter type. 

In the "programming" world, this is basically a desire to pass in an interface to a function. The interface is "Aggregate" or "List." How is such a thing done in OutSystems?

For your second question, In Outsystems you need to pass a typed list. So if you have an aggregate that is returning the User entity (table) then you have a parameter of List of User rather than List of Records.  

For the first it's a little more complex. If you have a known number of "widgets" then you can use a Switch statement or multiple If statements to pick which one will be refreshed via an ajaxrefresh depending on an input. Alternatively each one will likely be in a DIV so there "might" be a way to do it using javascript.

In this case, the Typed List could be a list of Users, or a list of Buildings, or a list of Clients. This is why I need to pass a LIST, not a typed list. A list is a data structure and I want to do iterate and operate on the list, but I don't care what's in the list.

Is there a way to do that?