I want to display a form in dialog at the end of the startup method, after the main start form has loaded, but I cannot get it to work correctly.
The whole sequence works fine in smart client, and the method to show the dialog works fine in web client if it is triggered from a button after the solution has loaded - so I assume there is no issue with the method itself when run in web client.
However, if I append the method to show the dialog as the last thing that happens in the start up method, what I get is the form that I want to show in the dialog appearing as the main form, instead of the main form loading first and the form in dialog showing in front after the main form has loaded.
So I guess my question is: should it be possible to show a startup form and then show a formInDialog in front of it, all from the main solution startup method?
I’m not sure you’re right on that - I set a lot of globals during startup and they all appear to be set correctly by the web client which means it must be running the startup method!
… so it should show the main form then display a form in dialog in front of it. When I run this in web client the main form does not show at all but the form in dialog shows as the controller form, but NOT in a dialog!
I have also tried creating a new instance of the form first, but the result is the same - its as if the web client waits for the last form called and displays that as the controller regardless.
Nicola, do you have experience of this working correctly? Is there a way to update the UI to show the main form before calling the form in dialog?
I’ve tested your code and it’s working for me in Safari on MacOS but it is not working in Firefox MacOS.
Write a simple sample solution and create a case in the support system so that Dev team can look into that.
Disable the startup method and try setting forms.main as the Solution first form. Then trigger application.showFormInDialog(forms.book_text_dialog,-1,-1,-1,-1,‘New form’,true,false,‘new form’, true); from a forms.main : onShow method.
Doesn’t work correctly for me in either - Safari does display the dialog but only after loading the dialog form as the controller form first, so I get the same form both as controller and in the dialog and don’t see the main form at all
In Firefox its as reported above - dialog form as controller and no dialog at all. Camino, unsurprisingly, behaves like Firefox.
In Opera, its like Safari except the form in dialog shows as blank with no elements!
This is all on Mac OS X - haven’t tried Windows yet.
Are you saying that for you in Safari the main form does show correctly with the dialog form in front?
Always happy to oblige! - I did actually try this yesterday, but have tried it again. No startup method but with the method firing as an onShow - doesn’t seem to make any difference
Have you got this to work in the way you describe?
this could be a problem, because to show a dialog the parent page has to be shown first. Else there can’t be a dialog. Or in some browsers by luck or by accident the sequence of events are just right and it will work. Also the dialog can only be shown when there is an ajax request doing it. And solution startup isn’t an ajax request just a normal request url. So that is also a problem.
If somebody makes a case for this then we can look into it.
No I hadn’t tested yesterday as had big deadline and was sure that I had done something very similar. However have been ‘playing’ with it this morning.
IE & Firfefox on XP are much the same as OSX browsers - the dialog form is shown in the background then after a short delay the popup dialog also appears.
Tried adding extra commands to the onShow to delay triggering the dialog but no change.
Discovered that can display the background form and click a button to show the popup dialog immediately without a problem, but if try to trigger the same dialog popup in the onShow method the background form never shows.
This isn’t just an issue with solution startup methods - it also affects other navigation where I wish to go to a form and trigger a dialog as part of the onShow method for the form.