Submit Button Outside Another Web Block

This is how we wanted the screen look like:

So imagine a screen, with multiple forms inside it, being driven by a web block with buttons to do a continue or back onto the forms. There is an IF on the forms to whether show it or not.

The issue is that the value on the input is not being bound on the variable itself. Say Input_FirstName has the variable Employee.FirstName. When you trigger a OnParameterChange action on that web block, debugging it will show that the Employee.FirstName is blank, even though you typed in something on the Input_FirstName control. Adding a button otherwise works fine.

Anybody else had this approach and had it working?

Attaching the OML

Solution

Hello Juan Carlos,


There are two issues in your current implementation:

1. If condition affects the rendering of widgets or web blocks-- when it is False your widget is essentially erased along with its variables' values.

2. OnParameterChange reevaluates the input variables into its unaltered values-- the values directly passed by its parent. This meant that during this event changes made in the input widget are overwritten by the value passed by the parent.


Here are the solutions to the issues mentioned above:

1. Use CSS to hide the web blocks instead. (Using Visible property also affects rendering, so it's no good)

.Hide {
    display: none;
}

 


2.

a. Bind the input widget to a local variable instead.

b. In the OnParameterChange assign the value of the local variable to the input variable.


Please note that I answered this based on the oml provided, and can be optimized further. ;)


Hope this helps!

- Emman

Solution

Juan Carlos Elorde wrote:

This is how we wanted the screen look like:

So imagine a screen, with multiple forms inside it, being driven by a web block with buttons to do a continue or back onto the forms. There is an IF on the forms to whether show it or not.

The issue is that the value on the input is not being bound on the variable itself. Say Input_FirstName has the variable Employee.FirstName. When you trigger a OnParameterChange action on that web block, debugging it will show that the Employee.FirstName is blank, even though you typed in something on the Input_FirstName control. Adding a button otherwise works fine.

Anybody else had this approach and had it working?

Hi  Juan Carlos Elorde,


You have binded the input variable of the block  to the input widget. And you are passing the input's empty, so empty values are replacing the value of the input widget 

As John Emmanuel Si mentioned, you need to bind the local variable instead of input.

I have modified your oml.. Please, refer that.. I have performed only for the continue action.


Hi Juan Carlos Elorde,

You are doing right but need some changes in that,

1) First Block for Firstname

2) second for Lastname

3) Create one block for continue and back Actions.

4) Create one local variable for employees structure and another screen for Page numbers in parant Screen.

5) 5.1. create a form inside first block with text input.

5.2. Create input parameter as firstname for that block.

5.3. Create an action on change for the text input.

5.4. Create an event for that block and add input parameter for that event.

5.5. trigger that event in the on change action and assign current value of the tect input to that event input.

5.6. Create a callback event in parent for the block, there assign firstname value to the structure variable.

6) Repeat above step for other blocks too.

I have created an UIFlow as MyFlow and attached OML file. 

Hope it helps !!


If only I can make everyone's reply as the solution, I will. :)


but ultimately this is the solution:


Bind the input widget to a local variable instead.