Does anyone know how to destroy and then later recreate a widget in widgetOnScreen section AFTER the app loads?

3188
5
12-16-2015 02:41 AM
JoshuaDell1
New Contributor

I am building a custom widget that interacts with the Attribute Table widget.  I need to be able to destroy the Attribute Table widget and then later recreate the Attribute Table widget at some point after the user has initially loaded the application.  I have been able to successfully destroy the Attribute Table widget by calling its destroy() function, but I don't know how to recreate it. I basically need to make the Attribute Table widget completely reload just as the app does on the initial load. I have tried calling the _init(), onOpen() functions but doing so does not actually cause the Attribute Table widget to be recreated.

Thanks,

Josh

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Joshua,

   I am not sure this is practical. Why do you need to destroy and re-create the Attribute Table Widget?

0 Kudos
JoshuaDell1
New Contributor

I am developing a widget that provides functionality for the user to add and remove tabs as well as filter tables in the Attribute Table widget based on definition queries derived from selected values in 3 ComboBoxes.  When the user closes the widget I need to be able to "reset" the Attribute Table widget to the state that it was when the app initially loads.

I am seeing strange behavior when I programmatically add the original tabs that were within the Attribute Table's TabContainer before the user opened my custom widget.  Sometimes the column headers will display at the bottom of the tab and one of the tabs is just blank.  At this point I am thinking that a possible solution would be to cause the Attribute Table widget to be recreated when the user closes my custom widget.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Joshua,

   Have you tried calling _init function on the widget?

0 Kudos
JoshuaDell1
New Contributor

As I stated in my original post:

"I have tried calling the _init(), onOpen() functions but doing so does not actually cause the Attribute Table widget to be recreated."

0 Kudos
JennaWalz2
New Contributor II

Did you ever figure this out?

0 Kudos