Reviewing combox storage in Gwt-Ext

I created a forms panel and I present a pair of Combo Boxes in a storage panel that is populated through a response handler. the problem is, if I want to display the panel again, it displays combo boxes without storage, although I am rebuilding the panel. I tried debugging to find out the reason and surprisingly, although the Store combo box is null when called - comboBox.setStore (store) checks the (isRendered) property and considers it true and therefore does not add storage but just save the existing storage, which still zero.

I saw this problem in another scenaio where I created a resettable field set containing Combobox, On minimizes and maximizes the field set, and the store disappears for the same reasons.

Can someone please help me here, I am completely amazed here, I tried various options, but nothing works.

+4
source share
4 answers

Thank you for your comments, in fact I tried the approach to the plugin, but could not fully understand it, how would I get a storage descriptor that is not a public element of the component.

In any case, I tried something else, and when debugging, I found that although I create the component again when I click the show button, the identifier is transmitted the same way (which is desirable), but somehow there is already a previous link for this identifier available in Ext.Components components.

Therefore, there is a simple solution: Component comp = Ext.getCmp (id); if (comp! = null) comp.destroy ();

it really worked like a link that called (the isRendered () property of the ComboBox to return true is no longer available and therefore I can correctly see the repository.

Hope this helps others who are facing a similar issue. Thanks anyway for the answer.

+2
source

Have you tried the doLayout() FormPanel ?

0
source

ComboBox.view.setStore () should help.

If view is a private variable, just try to specify it between Combobox configuration options when creating. If this does not help, you can use the plugin:

 view_plugin = { init: function(o) { o.setNewStore = function(newStore) { this.view.setStore(newStore); }; } }; 

and add the line

 plugins: view_plugin, 

into the Combobox configuration.

Then you can call combobox.setNewStore (newStore) later in the code.

0
source

You need to write:

field = new ComboBox({plugins: view_plugin});

In your case, define my view_pligin code somewhere earlier. Or you can even include it in a line:

field = new ComboBox({plugins: { code of plugin });

Inside the plugin, all available properties and methods are available.

You can also change the store using field.setNewStore(store) at any time later.

0
source

Source: https://habr.com/ru/post/1276852/


All Articles