Hello,

I have to implement a messaging system for my application. I want all my 
conversations to be visible and the user should select one of those to open.
I'm creating a FlexTable from a List of Conversations returned to me via 
RPC.

My ideea to select one conversation of all available was to link the 
subject column with a normal servlet getting the id as a parameter.
But the ideea is I do not want to open another page to display the 
conversation. I want to display it on the same page. I wan't to clear the 
existing widget and create a new one with all the messages in the selected 
conversation.

How can I do that ? Link to GWT what was clicked, in order for it to clear 
the current widget and create a new one...
Or is there a better idea ? Like can it be done through RPC ?

Thanks in advance,
Andrei


DBGetAllConversationsAsync rpc = (DBGetAllConversationsAsync) 
GWT.create(DBGetAllConversations.class);
ServiceDefTarget tar = (ServiceDefTarget) rpc;
String moduleURL = GWT.getModuleBaseURL() + "DBGetAllConversationsImpl";
tar.setServiceEntryPoint(moduleURL);

rpc.getAllMessages(userInfo, new AsyncCallback<List<Conversation>>() {

@Override
public void onSuccess(List<Conversation> result) {
DOM.getElementById("loading").getStyle().setDisplay(Display.NONE);

int start = 1;

for (Conversation conversation : result) {
int id = conversation.getId();

flexTable.setHTML(start, 0, String.valueOf(id));
flexTable.setHTML(start, 1, conversation.getDate());

String username = userInfo.getUsername();
String source = conversation.getSource();
String destination = conversation.getDestination();

flexTable.setHTML(start, 2, source.equals(username) ? destination : source);
flexTable.setHTML(start, 3,
"<a href=\"" + GWT.getModuleBaseURL() + "viewConversation?id=" + id + "\">" 
+ conversation.getSubject() + "</a>");
flexTable.setHTML(start, 4, "0");
flexTable.setHTML(start, 5, "Unread");

start++;
}

}

@Override
public void onFailure(Throwable caught) {
...

}
});


-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to