[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[ews.eclipse.technology.rap] Re: Selection Listener Problem

Hi Kathiravan,

your code looks good, but I can find where is the place where the selection event is processed on the server side (in readData() or inside the designWidget.setSelectedPart). You need to call ControlLCAUtil.processSelection(Widget, Item, boolean) in readData() to fire a selection event based on this client code - req.addEvent( "org.eclipse.swt.events.widgetSelected", designWidgetId ); .

Best,
Ivan

Kathiravan wrote:
Hi,
I have written a custom widget which implements ISelectionProvider and when something is selected on the the view a selection event is sent to the listeners. My selection provider implementation then fires selection event to all the listeners. I have two views implementing ISelectionListeners.


1. A table based view gets the event (goes through the selectionChanged method) but i could not get the table item selected on it.

2. A Text view which basically updates the text based on the selection from custom widget. This works if i click on a different view and come back to the view with the custom widget. The text changes.

the java script basically does the following for the selected item.

req.addEvent( "org.eclipse.swt.events.widgetSelected", designWidgetId );
req.addParameter( designWidgetId +".selectedPart", selectionIndex ); req.send();


This invokes the readData method on the LCA.

readData method has the following implementation.

/*
     * Read the parameters transfered from the client
     */
    public void readData(final Widget widget) {
        ControlLCAUtil.processSelection(widget, null, false);
        DesignWidget designWidget = (DesignWidget) widget;
        String location = WidgetLCAUtil.readPropertyValue(designWidget,
                PARAM_SELECTED);
        designWidget.setSelectedPart(location);
    }

Is there anything wrong in the way i am doing it. Please help.