Form in dialog at end of startup method

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?

Hi David

I don’t think that WebClient triggers the solution startup method. However you could set it as an onShow method

Hi Graham,

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!

It should work, can you post the code you are using?

I have made a really simple example. The solution startup code is

forms.main.controller.show();
application.showFormInDialog(forms.book_text_dialog,-1,-1,-1,-1,'New form',true,false,'new form', true);

… 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?

drookwood:
I have made a really simple example. The solution startup code is

forms.main.controller.show();

application.showFormInDialog(forms.book_text_dialog,-1,-1,-1,-1,‘New form’,true,false,‘new form’, true);

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.

Just to humour me :)

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.

That should work as expected.

Hi Nicola,

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?

Interesting addition to the Firefox story - the dialog eventually showed up, after about 8 minutes :?

Hi Graham

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 :cry:

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.

Hi David

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.

One for the serious bug-busters I think :)

Thanks Graham - that all mirrors my experience. Will log a bug!

Sorry Johan - missed your post earlier.

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.

i fixed it for the 3.5.3+ release.

Johan,

That’s fantastic :D I was busy working on various workarounds for the web client version - now I don’t have to!

Looking forward to trying it out!