Skip to main content
Solved

Dialogpage in Mainintialisation

  • January 29, 2024
  • 3 replies
  • 44 views

Forum|alt.badge.img+4

I want to open dialogpage whenever we open application. I have tried to open dialog page from mainintilisation. its giving error. let me know if we should open dialog page from mainintilisation.

Best answer by Edo Nijmeijer

I’ve been asking around within the WebUI team to hear if there is a clear explanation of ‘the order of things’, at this stage of initialization and with respect to the WebUI. And I have to say now: there isn’t.

In order for the Dialog Page to be able to show, it certainly does need ‘WebUI’ to be present in a state that allows it to communicate with a model and have access to the available pages. MainInitialization seems like an unreliable place to try and hook into this exact moment. PostMainInitialization obviously comes ‘later' but could still be too early. I’m sorry I can’t be any more specific within actually diving into some experimentation myself.

All that being said, I guess it becomes important to see what your use case is, and what you’re actually trying to achieve. Maybe it is easier to just open the dialog from the onLoad of a (home) page?

3 replies

gabiservidone
Administrator
Forum|alt.badge.img+6
  • AIMMSian
  • 256 replies
  • January 29, 2024

After MainInitialization, AIMMS run the Libraries MainInitialization, then PostMainInitialization will run. This is probably why you are facing errors, try moving the OpenDialogPage to PostMainInitialization.  


Forum|alt.badge.img+4
  • Author
  • Ace
  • 12 replies
  • January 30, 2024

I moved openDialogPage to PostMainintilization. still i am seeing same error (pageId cannot be empty when opening a dialog page.)


Edo Nijmeijer
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 51 replies
  • Answer
  • January 30, 2024

I’ve been asking around within the WebUI team to hear if there is a clear explanation of ‘the order of things’, at this stage of initialization and with respect to the WebUI. And I have to say now: there isn’t.

In order for the Dialog Page to be able to show, it certainly does need ‘WebUI’ to be present in a state that allows it to communicate with a model and have access to the available pages. MainInitialization seems like an unreliable place to try and hook into this exact moment. PostMainInitialization obviously comes ‘later' but could still be too early. I’m sorry I can’t be any more specific within actually diving into some experimentation myself.

All that being said, I guess it becomes important to see what your use case is, and what you’re actually trying to achieve. Maybe it is easier to just open the dialog from the onLoad of a (home) page?



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator