PDA

View Full Version : Portlet refresh Problem



lgdito
11 Aug 2009, 9:56 AM
Hi - this is Lars, who really likes GXT!!!

But I have a problem with the portlet. I´m searching for a way to refresh / reload a portlet.
I´m Using GXT 2.0.1 and GWT 1.7 with eclipse plugin 3.5

My Scenario:
I try to show a Grid in a portlet. This is not the problem itself - pricipial this works fine.

My Problem:
But if i try to fill the grid from a ListStore wich is filled by an AsyncCallback i have an empty portlet with no data.

I think this is the reason:
This is becaus the AsyncCallback is slower than the GUI. Means the Gui shows the portlet faster then the RPC fills it with data.

I tried the following to find a solution:
I made a button which calls

porteltName.hide();
porteltNeme.show();
this doesn´t work :-(

I tried also the following:

portletName.removeFromParent();
portal.add(portletName);

this also didn´t worked.

After that:
I didn´t add the portlet at the initial start of the app.
Instead a made a button which made the following:

portal.add(portletName);

E Voila:
After app is loaded i wait 2 Seconds than press the button and the portlet comes up with the Grid and all my data is shown in the portlet.

Now my question:
How can a refresh / reload a portlet / portlet content???
I can´t find anything that works and now i hope anybody here has an idea!

Thanks a lot for every hint
Lars.

akbar107
17 Mar 2010, 5:23 AM
hi
you can resolve the problem by
REMOVE the portlet from the portal and then INSERT OR ADD the portlet into the portal
but remember this when you add the portlet after the remove you would call the service method means you call the service which on the server side

me customize the Portal class and edit or override the ADD method and add two new parameter Row and Column means targeted position where want insert or add the portlet

Example

portal.remove(Row,Column);
here you would call the server side service ...........
portal.add(portlet,row,column)
B)

f.sauter
17 Mar 2010, 6:37 AM
You can say


Portlet portlet = new Portlet();
portlet.setLayoutOnChange(true);
...
AsyncCallback..
portlet.add(grid);
...
setLayoutOnChange:
Specifies if the container's layout should be called when widgets are added or removed.

And you can say grid.getStore().setMonitorChanges(true);

The AsyncCallback can now fill and display the gridstore in the grid after rendering.