|
|
Re: custom RAP widget: how to notify SelectionListeners? [message #130305 is a reply to message #129962] |
Sun, 26 April 2009 23:51   |
Eclipse User |
|
|
|
Hi Ivan,
Your suggestion is much appreciated! I tried the approach you suggested
but it is not working.
I confirmed that my widget's JS file is capturing the selection event (by
alerting upon each selection. However the events do not seem to make it
to TableLCA#readData(), as logging here shows nothing happens after the
selection is made and the alert() shows a message.
Thanks if you get any ideas!
Some snippets:
TableLCA.java:
public void readData( final Widget widget ) {
Table table = ( Table )widget;
String selectedItem = WidgetLCAUtil.readPropertyValue( table,
"selectedItem" );
table.setSelectedItem( selectedItem );
log.info( "TableLCA.readData(): selectedItem=" + selectedItem);
ControlLCAUtil.processSelection( table, null, true );
}
Table.js:
google.visualization.events.addListener(chart, 'select',
function() {
var row = chart.getSelection()[0].row;
//this alerts appropriately upon selection:
alert('You selected ' + dataTable.getValue(row, 0));
this.setSelectedItem(dataTable.getValue(row, 0));
//fire selection event
var req = org.eclipse.swt.Request.getInstance();
var id = widgetManager.findIdByWidget( this );
req.addEvent( "org.eclipse.swt.events.widgetSelected", id );
req.send();
});
David Donohue
|
|
|
Re: custom RAP widget: how to notify SelectionListeners? [message #130369 is a reply to message #130305] |
Mon, 27 April 2009 03:59  |
Eclipse User |
|
|
|
Hi David,
if the TableLCA#readData is not called at all after the request being
sent from the JS, the problem is somewhere else. After the request from
the client is sent, the Lifecycle is executed on the server. The
readData is part of this life cycle. Did you check for JS errors? With
Firebug for example.
Best,
Ivan
David Donohue wrote:
> Hi Ivan,
> Your suggestion is much appreciated! I tried the approach you
> suggested but it is not working.
> I confirmed that my widget's JS file is capturing the selection event
> (by alerting upon each selection. However the events do not seem to
> make it to TableLCA#readData(), as logging here shows nothing happens
> after the selection is made and the alert() shows a message.
>
> Thanks if you get any ideas!
>
> Some snippets:
>
> TableLCA.java:
> public void readData( final Widget widget ) {
> Table table = ( Table )widget;
> String selectedItem = WidgetLCAUtil.readPropertyValue( table,
> "selectedItem" );
> table.setSelectedItem( selectedItem );
> log.info( "TableLCA.readData(): selectedItem=" + selectedItem);
> ControlLCAUtil.processSelection( table, null, true );
> }
>
>
> Table.js:
> google.visualization.events.addListener(chart, 'select',
> function() {
> var row = chart.getSelection()[0].row;
> //this alerts appropriately upon selection:
> alert('You selected ' + dataTable.getValue(row, 0));
> this.setSelectedItem(dataTable.getValue(row, 0));
>
> //fire selection event
> var req = org.eclipse.swt.Request.getInstance();
> var id = widgetManager.findIdByWidget( this );
> req.addEvent( "org.eclipse.swt.events.widgetSelected",
> id );
> req.send();
> });
>
> David Donohue
>
|
|
|
Powered by
FUDForum. Page generated in 0.06634 seconds