Working with dialogs (mapp View)

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.

based on your description I would assume that each content for dialog is completely unique, so it is not only that some parts are different e.g. pictures or texts etc. Then I would solve it same way as you and I would use solution B this means one dialog with default empty content (only background color), more contents and use action load content in area. Is it not like that every time when dialog is loaded, default content is loaded first (that is why I would assign empty one as a default) and then it is replaced with one use for action LoadContentInArea? I can not test it now…but let me know if Im mistaken :slight_smile:

1 Like