Output variables in WebBlocks

By Hugo Bento on 10 May 2011
That's about it.
Add output parameters in WebBlocks so you can reuse the data on parent screen or block.
Kilian Hekhuis11 May 2011
I really don't get what you mean - a WebBlock is a screen element, so when do you want output? Also, what has that to do with reuse of data?
Hugo Francisco13 May 2011
I get what he means with output parameters.
He wants to access variables / information inside a web-block.


Could be handy sometimes like when you have the same web-block 2 or 3 times in the same parent screen.
Hugo Bento20 May 2011
Yes, that´s what I mean, I want to pass a variable to a webBlock that can be accessed in the parent window.

In .net you have ascx controls with public properties, those properties you can "set" and "get" from parent windows (or parent controls for that matters)
Hugo Bento20 May 2011
In addition to what I've commented previously I just thought I posted another Idea that I hope it makes more sense for you Kilian.
http://www.outsystems.com/wisdomofthecrowds/IdeaComment_List.aspx?IdeaId=783

C
heers
Rebecca Hall1 Mar 2012

Isn't a "NotifyWidget" action supposed to be able to pass values from a web block back to the parent?

Kilian Hekhuis2 Mar 2012
There's only the Message parameter, so if you want to pass multiple values, you'll have to serialize them or the like. Quite a pain actually, but sometimes the only possibility. Also, if there's no button inside that triggers something, you have to do that on each OnChange. Feasible, but totally unnecessary if OS would implement a sane way to access the data inside the webblock (e.g. WebBlockName.WidgetName.DataElement).
enigma23 Sep 2012
How about output parameters for web blocks?

This could help reusing upto single fields. And reduce bugs, ie. where accidently one attribute wasnt set in 2 out of 50 fields, which then lead to invalid inputs and ofcourse a big expedition to finding the two faulty fields.

ie. you have a date input field, which needs a special logic and is used accross all espaces.
Input field

You can create a webblock, with the input field and all required logic, preparation, actions, style etc

Have an input parameter, for the current or initial date and then the new output parameter, to return the changed value.
Date WebBlock

Now the webblock can be implemented in any form, to update the date in any table.
Example Form
(in this example, the date chunk is used for the date of birth. but it would also be any other date field, in other forms, from other tables)

Merged from 'WebBlock - Output Parameter' (idea created on 2012-09-23 16:24:32 by enigma), on 2016-10-25 13:01:17 by Goncalo Borrega
Rebecca Hall1 Oct 2012
You can notify the parent page / web block using the "NotifyWidget" action and pass these values.

Merged from 'WebBlock - Output Parameter' (idea created on 2012-09-23 16:24:32 by enigma), on 2016-10-25 13:01:17 by Goncalo Borrega
enigma7 Nov 2012
Thank you very much for the hint! =)
But wouldnt you also preffer an output parameter?
For transparency, but also you wouldnt have to call an action for every such field in the form.

Merged from 'WebBlock - Output Parameter' (idea created on 2012-09-23 16:24:32 by enigma), on 2016-10-25 13:01:17 by Goncalo Borrega
Niels Favreau30 Jan (3 weeks ago)

Bump
Using OnNotify is such a pain ... That means for every onchange on a field you have to onNotify to the parent and the parent should handle the new changes. Like Kilian Mentioned.

It's really a pain when you have a page with global save, and some form parts are being reused on other pages.
Using OnNotify is almost impossible to maintain and keep the code simple and readable.

Using output parameters (for example of type record) would simplafly by alot this complexity.

leonardo.fernandes30 Jan (3 weeks ago)

Hi Niels. Have you checked the Event System component? It's meant to simplify reusing forms, global saves, validations and a lot more.