I have a second form (Form2) with the same subform(Subform1). When I open this second form in Dialog. Subform1 from Form1 disappear and sometime become a grey rectangle.
Just like you can’t show the same form twice (or more) on 1 form using tabpanels you can’t show it twice (or more) in dialogs.
What you need to do is create a new instance of that form and use that in the dialog. You can do this dynamically or in design time (dupe a form).
After this you can address that form by the name you gave it.
See further in the example code (control-n in the editor):
//Create a new form instance
var ok = application.createNewFormInstance('orders','orders_view');
if (ok)
{
application.showFormInDialog(forms.orders_view)
//forms['orders_view'].controller.show()
//forms.xyz.elements.myTabPanel.addTab(forms['orders_view'])
//forms['orders_view'].elements.mylabel.setLocation(10,20)
}
BTW. If you want to clone that original form 1 you also have to take care of cloning the subform (in the tab panel) as well. So cloning a form with a tab panel showing other forms is more tricky. Basically you have to clone the form with the tab panel, remove all tabs, create clones for all forms that were shown in tabs and add those as tabs again. A bit complicated…
Marcel answers between 8 and 12
You between 12 and 16
I between 16 and 20
Looks like the 2007/08 competition for 'Most answers on the Forum" is going to be pretty intense this year. I guess it allows us mere mortals to ‘vote’ for our favourite ‘responder’ by choosing carefully the time we post a question