WEbblock form as part of screen form

WEbblock form as part of screen form

  

hi there, 

i have a form that contains some fields and it is used by many screens so that i decide to create a web block. My question is how the best technique to achieve this?

I stuck on the variables bound to the fields in the webblock when they are called from screens. I mean do i need to pass variable by reference (is it possible) or should i use variable session or should i use getValues action to get the webblock fields' values to the screen or else...

What it the best practise?

regards and thank you,

A



Hello A,


When you reuse code in many screens, it is a good practice to create a web block.

Obviously, you want to show different outputs in the many screens where you put your web block, so i think the best thing to do is to use input parameters in the web block and show the info as these inputs change from screen to screen.


I hope this helps you.

Rafael Valente

I mean the variable passed as input parameter from screen will be used as variable for field input in the web block, and hopefully it is passed by reference. tq

What do you mean by reference?



i mean parameter is passed by reference to the web block, instead of by value. tq

Solution

Hello A,

Ok, i get it now. Try to check this post: https://www.outsystems.com/forums/discussion/13103/input-parameters-as-reference-shared-variables-web-block/

It's a bit old but hopefully, it can answer your questions.


Best regards, 

Rafael Valente


Solution