ON CHANGE EVENT ON HEADER TO UPDATE SCREEN VARIABLE
Application Type
Traditional Web

Hi, I have a drop down with a list of mines on the header (menu) tab.

Then I have a screen BLAST DETAIL. 

When I change the mine in the drop down on the header I want the change to be automatically effected on the mine field in the BLAST DETAIL screen.

The mine field in the Blast detail page will eventually need to be a read-only field which is disabled. Each time the header drop down is changed, the field in the Blast Detail must refresh and show the same mine as on the header.

Attached is the oml file

test.oml

mvp_badge
MVP
Solution

Hi Rudo,

As already suggested by carlos, the mentioned use case can be implemented in the Traditional web application using the Web block Event handler mechanism.


Implementation Steps:

  1. Create an event with an input parameter in the header web block scope.
  2. Set the event to be non-mandatory (If it is a common menu block it would be referred in multiple screen and setting the event to non-mandatory will let you keep the handler definition optional).
  3. In the header Dropdown On change, trigger the defined event - passing the selected dropdown value as the event input parameter value.
  4. In the respective screen, define the event handler flow and assign the handler input parameter value to the local variable, which is mapped with the dropdown and then ajax refresh the respective dropdown widget.
  5. Set the dropdown enable property boolean value to be conditional in order to achieve the read-only use case

See this sample app: HeaderWebBlockEventDemo

Refer to the attached .oml file


I hope this helps you!


Kind regards,

Benjith Sam

DigitalLabWBEventHandler.oml

Thank you so much

mvp_badge
MVP

You're most welcome, Rudo

I'm glad it helped you :)


Kind regards,

Benjith Sam

Hello Rudo,

you need to add an onchange handler in your dropdown
so when someone changes the selection you refresh the widget were you have the mine details

test.oml

Hi, I do understand the logic but what's tricky on my end is that the drop down and the mine input field are not on the same screen. This may mean I need to pass a variable to the screen etc... I'm just confused. Do you mind assisting on the oml file I sent

I've changed the Mine details screen and the menu block.
There are still some error because other screens.
But I don't know what you expect when you swicth the dropdown value for instance in the Mine List.

please check the oml.

Best Regards
CR

test.oml

when you click the drop down, the same value selected must automatically appear in the mine field. This  mine field in Blast detail will be a read only field there won't be a drop down


I'm not sure if I followed..
but if you want your selected Mine to be selected across multiple screens you need to declare the variable as a session variable instead of a srceen variable.

Everything else is controled with Events and Event handlers
so if you havethe drop down in the menu tied with a session variable you can know its value everywhere.

Then is just a matter of refreshing the rigth blocks of the screen when you changethe selection

But how do you know the webblock need to refresh?

This is why you need events. this can be done best with reactive. 

you have events in tradicional as well.. not following you

There is only the onnotify event you can use to send an event from 1 webblock to the parent.

You can ofcourse use this event.

fot his you need reactive, so you can create an event in your header webblock. In the onchange of the dropdown you fire the event.

In your screen you create a client action for the handler of the event in the header.

mvp_badge
MVP
Solution

Hi Rudo,

As already suggested by carlos, the mentioned use case can be implemented in the Traditional web application using the Web block Event handler mechanism.


Implementation Steps:

  1. Create an event with an input parameter in the header web block scope.
  2. Set the event to be non-mandatory (If it is a common menu block it would be referred in multiple screen and setting the event to non-mandatory will let you keep the handler definition optional).
  3. In the header Dropdown On change, trigger the defined event - passing the selected dropdown value as the event input parameter value.
  4. In the respective screen, define the event handler flow and assign the handler input parameter value to the local variable, which is mapped with the dropdown and then ajax refresh the respective dropdown widget.
  5. Set the dropdown enable property boolean value to be conditional in order to achieve the read-only use case

See this sample app: HeaderWebBlockEventDemo

Refer to the attached .oml file


I hope this helps you!


Kind regards,

Benjith Sam

DigitalLabWBEventHandler.oml

Thank you so much

mvp_badge
MVP

You're most welcome, Rudo

I'm glad it helped you :)


Kind regards,

Benjith Sam

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.