Invoke a webblock action from a screen (with output arguments)

By Goncalo Borrega on 11 May 2010
This would allow to have isolation on the webblocks and have the screens coordinate several sections of the page, all in the same transaction.
Ex: The screen manages a person, and we have a webblock responsible for saving the address section, another the contacts, and another the general detail. The button Save on the Screen would call all the Saves in the webblocks.

This would increase reusability a lot.
lef11 May 2010

I agree with the need, but I would probably implement it with webblock callbacks inside the same transaction.
Goncalo Borrega12 May 2010
As long as the callbacks start having strongly typed parameters (one of the strongest points the platform has gotten us used to) and it has an output....
Gonçalo Almeida11 Jan 2012
I believe this idea could be "joined" with this one: http://www.outsystems.com/wisdomofthecrowds/IdeaComment_List.aspx?IdeaId=555

This is so necessary when you want to implement your own controls.
Célia Corte7 Aug 2014
Or like this one http://www.outsystems.com/ideas/1212/webblock-output-parameter/
In .Net you can create a public property with an object from a UserControl/webBlock and the main page can call it as a output parameter in Outsystems.
For example:
Page A has a UserControlX.
The UserControlX  has a textBox "Name" and a checkBox "Visible"
Page A can access the information inside the UserControl:  UserControlX.MyEntity
UserControlX :
public string MyEntity
    {
        get
        {
           return GetMyWebBlockData();
        }
    }
 
 
public MyEntity GetMyWebBlockData()
    {
           MyEntity myEntity = new MyEntity();
 
           myEntity.Name = txtName.Text;
           myEntity.Visible = cbxVisible.Check;
              
 
           return myEntity;
         
    }
 
In my situation I’ve a save button in the Page A and I would like to save the information inside UserControlX/WebBlock.
Tim Timperman24 Jul 2015
We really really need public variables on webblocks as everyone is running into this limitation.
I've seen some really nasty workarounds involving session variables and it is blocking a lot of scenarios where webblocks (with public variables) would be the perfect and very clean solution.
This is already possible with the Event System component. Check its documentation - on Lesson 05 it is shown how to split a form into fragments, each on its own web block. And how to save all fragments from a single save button inside the screen.
Kilian Hekhuis30 Jul 2015
@Tim: we use NotifyWidget callbacks + serializing data, but yeah, it's dirty.
@Leonardo: of course someone made something to make it possible, but I'd like a native solution!
André Siébra30 Jul 2015
Event System component is awesome Leo. Great Job! :)

But we still don't have a good and native solution to access information inside a webblock. Webblocks with public variables (like @Tim idea), with output parameters or passing parameters by reference are good solutions 
(and very old too), but for uknown reasons they never was attended...
André Siébra30 Jul 2015
Event System component is awesome Leo. Great Job! :)

But we still don't have a good and native solution to access information inside a webblock. Webblocks with public variables (like @Tim idea), with output parameters or passing parameters by reference are good solutions 
(and very old too), but for uknown reasons they never was attended...
Gonçalo Almeida12 Nov 2010
Hi,

When you drag a web block to a screen, we should be able to access all widgets inside that web block, while we're in the context of that screen.

Since a web block is rendered just as a simple copy of code to the screen, the widgets should be accessible at runtime, and thus, at design time.

Merged from 'Accessible widgets inside Web Blocks' (idea created on 2010-11-12 16:12:57 by Gonçalo Almeida), on 2016-10-24 14:17:35 by Goncalo Borrega
Hans de Vries13 Dec 2010
Agreed!

I now need to do some 'funky stuff' to get output from a web-block.

It would be nice to be able to declare some variables inside a web-block as 'public'



Merged from 'Accessible widgets inside Web Blocks' (idea created on 2010-11-12 16:12:57 by Gonçalo Almeida), on 2016-10-24 14:17:35 by Goncalo Borrega