How to use untyped events in RAP [message #777323] |
Tue, 10 January 2012 09:22 |
ZungNV Abel Messages: 16 Registered: November 2010 |
Junior Member |
|
|
I'm developing an application based on RCP.Recently, I have moved it to RAP. Before, I used some untyped events in RCP to pass some necessary data for different purposes. For example, I have a button called "Get Data" to get data from server. I have some tableviewer to hold data that were received from server.When user click this button, I want to raise an event, and in each table will listen that event. I did as following:
//Part 1
Button btgetData=new Button(compositeLabels,SWT.PUSH);
btgetData.setText("Get Data");
btgetData.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
//raise event here
Event event =new Event();
event.detail=12345;
getRoot().getShell().notifyListeners(MYEVENTCONST, event);
}
});
//Part 2:
//In each composite that hold TableViewer , listen event
getShell().addListener(MYEVENTCONST, new Listener()
public void handleEvent(Event event) {
if(event.detail==12345)
doProcessing();
});
In RCP, each TableViewer listen normally that event each time user click button "Get Data". But it didn't work on RAP, I don't know if RAP already supported this kind of untyped events. THe fucntion doProcessing() is never called :(.
I don't want to change the way when passing data. Please let me know if I could keep going in the old way. I greatly appreciate for any comment.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04007 seconds