Excerpts from the listener class
// RemoteEventListener is an Interface of the GigaSpaces middleware
// the class is very similar to the example UserProvider , and holds a list
of user calendars;
// I omit here details
public class UserProvider extends SortableDataProvider implements
RemoteEventListener{
DataTablePage compo = null; // the page containing the DataTable
.........
// this is the event listener method itself, called from the Gigaspaces
library
// when some eventon their space is detected
public void notify(RemoteEvent theEvent) throws UnknownEventException,
RemoteException {
System.out.println("In notify!!");
Contact cc = new Contact(new Name("abc", "def"));
userList.add(cc)
// replace the previous defaultdatatable with this one, containing
one more user
compo.replaceTable(this);
System.out.println("\n\AFTER REPLACE\n\n");
}
// now the wicket page class
public class DataTablePage extends WebPage {
// similar to the example with this method added
.....
public void replaceTable(UserProvider userProvider){
List userList = userProvider.getUsers();
List columns = new ArrayList();
Iterator it = userList.iterator();
int i =0;
while (it.hasNext()) {
Contact s = (Contact) it.next();
columns.add( new PropertyColumn(new Model(s.getName().getFirst()),
"index"));
}
// THE NEXT LINE causes the error
table.replaceWith(new DefaultDataTable("datatable", columns,
userProvider, 10));
}
--
View this message in context:
http://www.nabble.com/updating-a-page-when-external-event-occurs-tp20770960p20771378.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]