Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Getting resize events from js
Getting resize events from js [message #991820] Thu, 20 December 2012 09:16 Go to next message
Christian Hager is currently offline Christian Hager
Messages: 52
Registered: July 2009
Location: Germany
Member
Hi, I'm trying to build a custom widget based on the custom widget template from https://github.com/tbuschto/customWidgetTemplate. Up to now almost everything worked quite well.
There is just one thing I couldn't figure out up to now and I was wondering if anyone here could give me a hint on how to solve this.
How can I get a resize event in the javascript when the widget is resized? I need to resize the contents of the widget when the widget is resized and since there is no need to communicate with the server I thought it would be best to do this in the js.

Thanks in advance for any help or hints.

Christian
Re: Getting resize events from js [message #993224 is a reply to message #991820] Sun, 23 December 2012 20:10 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 383
Registered: July 2009
Senior Member
Hi.

As far as i know there is no way to get a resize event directly from a
DOM element. The quick solution would be to only use % or set it from
the server. But perhaps this is something where RAP API should support a
custom widget developer with a resize event. If you think so, open an
enhancement request on the RAP bugzilla where we could discuss this.

Thanks,
Tim


Am 20.12.2012 10:16, schrieb Christian Hager:
> Hi, I'm trying to build a custom widget based on the custom widget
> template from https://github.com/tbuschto/customWidgetTemplate. Up to
> now almost everything worked quite well.
> There is just one thing I couldn't figure out up to now and I was
> wondering if anyone here could give me a hint on how to solve this.
> How can I get a resize event in the javascript when the widget is
> resized? I need to resize the contents of the widget when the widget is
> resized and since there is no need to communicate with the server I
> thought it would be best to do this in the js.
>
> Thanks in advance for any help or hints.
>
> Christian

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/

[Updated on: Fri, 28 December 2012 13:53]

Report message to a moderator

Re: Getting resize events from js [message #997633 is a reply to message #991820] Tue, 08 January 2013 09:58 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 383
Registered: July 2009
Senior Member
Hi.

For your information, this is now supported in RAP master.
The Composite has three new methods, I'm posting the JsDoc since it's
not yet in the developers guide:

/**
* @name getClientArea
* @function
* @memberOf Composite#
* @description Returns the client Area of the Composite
* @returns {int[]} the client area as array [ x, y, width, height ]
*/

/**
* @name addListener
* @function
* @memberOf Composite#
* @description Register the function as a listener of the given type
* @param {string} type The type of the event (e.g. "Resize").
* @param {Function} listener The callback function
*/

/**
* @name removeListener
* @function
* @memberOf Composite#
* @description De-register the function as a listener of the given type
* @param {string} type The type of the event (e.g. "Resize").
* @param {Function} listener The callback function
*/


Greetings,
Tim

Am 20.12.2012 10:16, schrieb Christian Hager:
> Hi, I'm trying to build a custom widget based on the custom widget
> template from https://github.com/tbuschto/customWidgetTemplate. Up to
> now almost everything worked quite well.
> There is just one thing I couldn't figure out up to now and I was
> wondering if anyone here could give me a hint on how to solve this.
> How can I get a resize event in the javascript when the widget is
> resized? I need to resize the contents of the widget when the widget is
> resized and since there is no need to communicate with the server I
> thought it would be best to do this in the js.
>
> Thanks in advance for any help or hints.
>
> Christian

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Getting resize events from js [message #997676 is a reply to message #997633] Tue, 08 January 2013 14:31 Go to previous message
Christian Hager is currently offline Christian Hager
Messages: 52
Registered: July 2009
Location: Germany
Member
Hi,

thanks that sounds great. I will try it in the next days.

Christian Hager
Previous Topic:Clientscripting does not work with RAP 2.0 M4
Next Topic:Rap exaple does not work
Goto Forum:
  


Current Time: Wed Sep 17 11:42:11 GMT 2014

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

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