PDA

View Full Version : loadIndicator does not disappear.



lukeC4R
20 Dec 2010, 3:16 AM
Hello,

I need to have a various number of fields, depending of datas returned by an Ajax request, in a Panel.
So I first create and render my Panel, then in the callback of my ajax Request, I add the fields a call doLayout() to make them appear.

I want to have a load indicator, before the fields are loaded, so the user will see that fields are coming, but not a mask, so he can make other stuff while loading. So I used this :

myPanel.getUpdater().showLoading();

which works perfect, but, I don't know how to make it disappear when I add my fields.

I looked in the Updater class, the loadText is inserted directly in the InnerHTML of the dom element, but this is not accessible after the panel is rendered, isn't it ? And since the text is not a Panel's comp, calling removeAll() before adding my fields doesn't help.

Someone 's got an idea ?
Thanks for your help,
luke

Condor
20 Dec 2010, 3:27 AM
I recommend using:

myPanel.body.mask('Please wait...');
...
myPanel.body.unmask();

lukeC4R
20 Dec 2010, 4:45 AM
I don't want a mask because the user can make other thing while the ajax request is processed.
I solved my probelm by rendering a first panel with the loadText, then destroying it and rendering another panel in the same div. Anyway, if someone's got a more elegant way to hide the rendering text, I'll be glad to hear it...