Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RWT (1.4M7) + UploadWidget
RWT (1.4M7) + UploadWidget [message #669702] Wed, 11 May 2011 08:26 Go to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
Hi,

I am upgrading my software to RAP 1.4M7. I only use a RWT standalone configuration. In my application I need the upload widget.
In previous versions I made a hack to initialize the resources/themings for the upload widget.

This hack does not work anymore starting with RAP 1.4M7.

The Hack:
I registered a ServletContextListener before the RWTServletContextListener.
In this listener I added the resource und themeable widgets informations. (Direct api calls to ResourceRegistry.add(...) and ThemeManager.addThemeableWidget(...).

In RAP 1.4M7 the ResourceRegistry/ThemeManager needs a ApplicationContext which is initialized in RWTServletContextListener.
The problems is once RWTServletContextListener is finished the ThemeManager does not allow new calls to ThemeManager.addThemeableWidget.

What is the best way to solve this problem?

Thanks,
Oliver
Re: RWT (1.4M7) + UploadWidget [message #669782 is a reply to message #669702] Wed, 11 May 2011 14:10 Go to previous messageGo to next message
Frank Appel is currently offline Frank AppelFriend
Messages: 46
Registered: July 2009
Member
Oliver,

there is still a bug open regarding your problem #274481: Adding themeable widgets not supported in RWT standalone

I contacted Ralf, but a fix will not make it into the 1.4 final. So that leaves us with hacking. I suggest you create a copy of the RWTServletContextListener and use this instead of the original one.

To do so create a package org.eclipse.rwt.internal.engine in your application used by the copy. The latter is necessary to allow package private method access to utility classes. Now modify line 102 of your copy to do what your extra ServletContextListener had done. I've attached an example copy that has a comment at the given line. Note that the copy is taken from CVS-Head. So the source might be slightly different from your version.

Last but not least modify your web.xml to use the copy context listener. Hope it works, since I have not tried it by myself yet...


Regards and Good Luck
Frank
Re: RWT (1.4M7) + UploadWidget [message #669957 is a reply to message #669702] Thu, 12 May 2011 07:49 Go to previous messageGo to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
Hi Frank,

thanks for the information.
But I already implemented another workaround by patching the RWT-Library.

I attached my patch.

I will change this when bug #274481 is implemented.

Thanks,
Oliver
  • Attachment: patch.txt
    (Size: 2.83KB, Downloaded 404 times)
Re: RWT (1.4M7) + UploadWidget [message #677756 is a reply to message #669957] Thu, 09 June 2011 10:17 Go to previous messageGo to next message
Swap  is currently offline Swap Friend
Messages: 30
Registered: March 2011
Member
Hi Oliver,

I also need upload widget in my application.
How it can be done?

Will you please help me for same?
Re: RWT (1.4M7) + UploadWidget [message #677778 is a reply to message #677756] Thu, 09 June 2011 11:26 Go to previous messageGo to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
Hi Swap,

please note that this is an inofficial workaround for RAP 1.4.

You need to compile my patch into your RWT version and you need the latest upload widget plugin from CVS.

Then you add the following to your web.xml:

  <context-param>
    <param-name>org.eclipse.rwt.resources</param-name>
    <param-value>
    	org.eclipse.rwt.widgets.internal.resource.UploadButtonResource,
    	org.eclipse.rwt.widgets.internal.resource.UploadResource,
    	org.eclipse.rwt.widgets.internal.resource.UploadFieldResource,
    	org.eclipse.rwt.widgets.internal.resource.UploadFormResource,
    </param-value>
  </context-param>
  <context-param>
    <param-name>org.eclipse.rwt.themeableWidgets</param-name>
    <param-value>
	org.eclipse.rwt.widgets.Upload
    </param-value>
  </context-param>


After that you can use the upload widget in RAP 1.4.
Re: RWT (1.4M7) + UploadWidget [message #682074 is a reply to message #677778] Fri, 10 June 2011 10:54 Go to previous messageGo to next message
Swap  is currently offline Swap Friend
Messages: 30
Registered: March 2011
Member
What do you mean by "need to compile ur patch into your RWT version" ?
Re: RWT (1.4M7) + UploadWidget [message #682083 is a reply to message #682074] Fri, 10 June 2011 11:30 Go to previous messageGo to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
You need to checkout the targeted RWT version from CVS. After that you apply the patch (see posting above) to the RWT project.
Re: RWT (1.4M7) + UploadWidget [message #682108 is a reply to message #682083] Fri, 10 June 2011 12:28 Go to previous message
Swap  is currently offline Swap Friend
Messages: 30
Registered: March 2011
Member
Thanks for reply
Previous Topic:Communication Framework for RAP
Next Topic:Rap &amp; Browser Support
Goto Forum:
  


Current Time: Thu Mar 28 22:40:55 GMT 2024

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

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

Back to the top