showFormInDialog() Height Parameter not Honored

Version: 5.1.1 - build 958

I have a basic form that contains a textarea field. I use the solutionModel to clone this form, modify the textarea field height, then display the cloned form using showFormInDialog() or FID. The first instance of FID is displayed with the correct height, however, subsequent FID instances are displayed with the first instance’s height no matter what height value it is given.

Other forms are displayed in FID with the proper height and width, but not with repeated instances of the cloned form (the cloned form is destroyed between each FID call and re-cloned).

I read a post on the Forum that said you have to supply both the height and width parameters (which I do) when calling the FID method, not just the height parameter.

Why is the FID height parameter not being honored?

Thanks!

I think is best to open a case in our support system ( http://www.servoy.com/s ); would be nice to also attach a sample.

We reported a similar issue to Servoy not too long ago. We were told that application.showFormInDialog uses the width and height only as initial settings. Any additional calls to open this form in dialog will not respect the width and height at all. To get around this, use application.setWindowSize(width,height,[windowName]) after the showFormInDialog command. It works nicely.

Show the specified form in a dialog. (NOTE: x, y, width, height are initial bounds - applied only the fist time a dialog is shown)

Hope this helps

Lenore

Laurian,

Case #284261 has been opened. I also uploaded sample code.

Hi, Lenore.

Thanks for the tip!

We are using a modal FID call, so I am not certain your suggestion will work as no code is executed until the modal window is closed…but, I will try it. I am certain I will find it useful for non-modal FID calls!

Servoy…

What is troublesome for me, is that we are destroying the form prior to re-creating it. Hence, FID should have no a priori knowledge of the form, and the new FID height should be honored (destroyed form, destroyed initial settings).

I also do not understand the reasoning behind the FID height and width initial settings. As a developer, I want control of the FID height and width each time I invoke FID regardless of what form was previously used!

Hi Kim,

If you give the FID a unique window name (and I don’t mean the title text) then each call will set the height and width correctly. For Servoy it will be a brand new window.
Using this technique you can then also open 2 or more FID’s on top of each other and the other ones will stay open/visible instead of disappearing.

Hope this helps.

The idea behind only using the height/width for the initial show is that the user might resize the FID to his liking, so it would be very annoying for the user if everytime the FID is reopened, the size would be the initial size again.

As Robert already suggested, the remembering of the height/width of the FID is done based on the name of the FID. By showing the FID everytime with a different name, you force the use of the initial height/width again.

Paul

Thanks, Robert…I implemented your suggestion and got things working.

Thanks for the explanation, Paul. I would like to suggest that you add your explanation why FID height and width is retained to the documentation as the reason for it was not obvious to me (and others, too, I suspect).