Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Is there any documentation for the JavaScript org.eclipse.swt.Request-Object?
icon5.gif  Is there any documentation for the JavaScript org.eclipse.swt.Request-Object? [message #515273] Thu, 18 February 2010 10:35 Go to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Hello RAP-Community!

I followed the Google Maps custom widget tutorial on eclipse help. To make requests from client to server it is possible to use the org.eclipse.swt.Request.getInstance().addParameter() method.

In the LCA on the server I have to read out that paramaters and store them in my object. The question is: Does the Request-object have some other methods besides the "addParameter" method? Is there any documentation for the clientside JavaScript of RWT?

My problem is: I want to call a method from JavaScript form the clientside. That method does some modifications to other widgets (e. G. makes them vissible/invisible). I am calling that method out of the preserveValues method of the LCA of my custom widget. It works fine so far!
But I don't think this is a good method, since I don't know if the values of all widget that could be modifiend have been already preserved.

So maybe it is possible to fire an event directly form the Request-Object on a registered listener. Because this is done in the "processAction"-pahse all values have been surely preserved.

Best regards
Eduard
Re: Is there any documentation for the JavaScript org.eclipse.swt.Request-Object? [message #515423 is a reply to message #515273] Thu, 18 February 2010 17:23 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Eduard,

if you really need to execute something in the process action phase,
simply wrap it in ProcessActionRunner like:
public void readData( final Widget widget ) {
// read your properties from the client
ProcessActionRunner.add( new Runnable() {
public void run() {
// set them to the java widget in process action phase
}
} );
}

HTH,
Ivan

On 2/18/2010 12:35 PM, Eduard wrote:
> Hello RAP-Community!
>
> I followed the Google Maps custom widget tutorial on eclipse help. To
> make requests from client to server it is possible to use the
> org.eclipse.swt.Request.getInstance().addParameter() method.
>
> In the LCA on the server I have to read out that paramaters and store
> them in my object. The question is: Does the Request-object have some
> other methods besides the "addParameter" method? Is there any
> documentation for the clientside JavaScript of RWT?
>
> My problem is: I want to call a method from JavaScript form the
> clientside. That method does some modifications to other widgets (e.
> G. makes them vissible/invisible). I am calling that method out of the
> preserveValues method of the LCA of my custom widget. It works fine so
> far!
> But I don't think this is a good method, since I don't know if the
> values of all widget that could be modifiend have been already preserved.
>
> So maybe it is possible to fire an event directly form the
> Request-Object on a registered listener. Because this is done in the
> "processAction"-pahse all values have been surely preserved.
>
> Best regards
> Eduard
icon14.gif  Re: Is there any documentation for the JavaScript org.eclipse.swt.Request-Object? [message #515814 is a reply to message #515273] Sun, 21 February 2010 11:09 Go to previous message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Hi Ivan,

thank you for your hint. It works perfectly!

Here the affected code in the LCA. Probably someone else could use this too.

@Override
	public void readData(Widget widget) {
		 final CustomWidgetHelper helper = (  CustomWidgetHelper )widget;
		 String mouseclick = WidgetLCAUtil.readPropertyValue( helper, "mouseclicked" );
		 String browserResized = WidgetLCAUtil.readPropertyValue( helper, "browserresized" );

		 if(mouseclick != null){
			 helper.clicked = true;
		 }
		 if(browserResized != null){
			 helper.browserResized = true;
		 }
		 
		 // call methods in the process action phase
		 ProcessActionRunner.add(new Runnable() {
			
			@Override
			public void run() {
				if (helper.clicked) {
					helper.mouseClicked();
					helper.clicked = false;
				}

				if (helper.browserResized) {
					System.out.println("browserResized");
					helper.browserResized();
					helper.browserResized = false;
				}
			}
		});

	}


This code is basically part of a resize and mouse click listner for the Display since there is no native support for that in RAP.

Best regards
Eduard
Previous Topic:problem with context menu
Next Topic:Moveable Views/Editors
Goto Forum:
  


Current Time: Tue Dec 07 21:00:32 GMT 2021

Powered by FUDForum. Page generated in 0.01528 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top