Folder switch kills formsManager instances when hidden

Add-in Express™ Support Service
That's what is more important than anything else

Folder switch kills formsManager instances when hidden
 
Bert Sinnema




Posts: 55
Joined: 2015-04-16
Hi All,

I have an addin that has an ADXOLForm in each inspector. When the inspector is shown I hide the form because we only need it in certain conditions. When the ADXOLForm is not shown and I switch folders in the Explorer, the form instance in the inspector is disposed and will return null on formName.GetForm(inspector); If the form was already shown, it is not disposed.

Is this normal behaviour? If so, can I change that behaviour?

Thanks
Posted 11 Oct, 2018 05:16:08 Top
Andrei Smolin


Add-in Express team


Posts: 16662
Joined: 2006-05-11
Hello Bert,

Bert Sinnema writes:
When the inspector is shown I hide the form


How do you hide it? We suggest that you set ADXOlForm.Visible=false in the ADXBeforeFormShow event. In this case the form instance will be created but won't be shown. Calling GetForm(inspector) will return that instance.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Oct, 2018 07:44:26 Top
Bert Sinnema




Posts: 55
Joined: 2015-04-16
Thanks,

I got a bit lost in spaghetti code so I figured I do a lab project. Everything works as it should when I use your suggestion.

For those who are wondering how to implement multiple forms in a single form pane, I'm sharing my lab projects to the community: https://github.com/bertsinnema/MultiPaneFormsManager, feel free to fork and use in your own documentation.

As per documentation I have added to items to the formManager in the same sub-pane which are hidden by default. When you open a new email message, both forms have an instance on the inspector. Even when hidden I can call them at any point and I can switch between forms.

Best,
Bert
Posted 12 Oct, 2018 05:07:49 Top
Andrei Smolin


Add-in Express team


Posts: 16662
Joined: 2006-05-11
Hello Bert,

Thank you!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 12 Oct, 2018 07:04:48 Top