Hi Community!
I’m working with mapp View and I don’t know which may be the best approach when working with dialogs.
Context:
At a certain event (for instance, button click) a dialog with a certain content should be loaded into that dialog. The content to be loaded depends on the event (for instance, which button is click).
One possible solution would be to have as many dialogs as contents to be loaded in a dialog can be (so, a 1:1 relation). Each dialog has a certain content associated and when a certain event occurs (button click) then one dialog or another is opened. Below, some pseudocode is shown:
Event buttonA click
OpenDialog (client system action) → Dialog id = A
Event buttonB click
OpenDialog (client system action) → Dialog id = B
Another option would be to have only 1 dialog and load the content to be loaded into that dialog at runtime. Below, some pseudocode is shown:
Event buttonA click
session.VariableAction.SetValueString (sessionVariable = “A”)
OpenDialog (client system action)
Event buttonB click
session.VariableAction.SetValueString (sessionVariable = “B”)
OpenDialog (client system action)
Event DialogOpened
EventHandler: SessionVariable = “A”
LoadContentInDialogArea → ContentID “A”
EventHandler: SessionVariable = "B"
LoadContentInDialogArea -> ContentID "B"
As the actions to open a dialog and load content have an asynchronous behavior, the previously loaded content on that dialog may be visible for a short period of time (depending on the CPU load on the client, it may be visible for a shorter or longer period).
With that said, I don’t like the first option as I need a 1:1 relation (dialogs:contents) and also not the second one because of the inconvenience aforementioned.
I’d pretty much appreciate any input / idea to better solve this problem.
Thanks a lot in advance.