Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Javascript error on Hyperlink Widget(Javascript error on Hyperlink Widget)
Javascript error on Hyperlink Widget [message #1743720] Mon, 19 September 2016 08:34 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi all,

I'm trying to use Hyperlink widget in my standalone RAP application:

final Hyperlink linkLogout = toolkit.createHyperlink(form.getBody(), "Logout", SWT.NONE);
linkLogout.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(SWT.RIGHT, SWT.CENTER).create());


but always gets this exception:

Error: Error: Operation "create" on target "w8" of type "null" failed:
No Handler for type forms.widgets.Hyperlink
Properties: 
parent = w7
style = NONE
children = 
bounds = 946,34,37,17
tabIndex = 6
foreground = 0,0,255,255
background = 255,255,255,255
...


Is it possible at all ?

Thanks & Regards,
SetNug
Re: Javascript error on Hyperlink Widget [message #1743723 is a reply to message #1743720] Mon, 19 September 2016 09:16 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
the answer to your question is here; https://www.eclipse.org/forums/index.php/t/355753/
Regards,
Ivan
Re: Javascript error on Hyperlink Widget [message #1744516 is a reply to message #1743723] Tue, 27 September 2016 15:50 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi Ivan,

I've tried what's suggested by adding ServletContextListener this way:

public class SpringRWTServletContextListener implements ServletContextListener
{
	@Override
	public void contextInitialized(ServletContextEvent event)
	{
		final ResourceLoader loader = new ResourceLoader()
		{
			@Override
			public InputStream getResourceAsStream(String resourceName) throws IOException
			{
				return getClass().getClassLoader().getResourceAsStream(resourceName);
			}
		};
		
		final ThemeManager themeManager = new ThemeManager();
		themeManager.addThemeableWidget(Hyperlink.class.getName(), loader);
	}
	
	@Override
	public void contextDestroyed(ServletContextEvent event){}
}


And then I register it in web.xml.

But the problem persists.

Thanks & Regards,
Setya
Re: Javascript error on Hyperlink Widget [message #1744962 is a reply to message #1744516] Mon, 03 October 2016 12:42 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
when using the Workbench, the forms widget resources are registering with extension pont (see org.eclipse.rap.ui.forms/plugin.xml). The corresponding Java code that deals with these extension points is in WorkbenchApplicationConfiguration.
You have to do the same in your application configuration:
1. Register manually all the JS files defined in "org.eclipse.rap.ui.resources" extension pont
2. Add all these widgets as themeable widgets
Check WorkbenchApplicationConfiguration#registerResources and WorkbenchApplicationConfiguration#registerThemeableWidgets as a code example.
HTH,
Ivan
Previous Topic:Redirect Page
Next Topic:RAP 3.2
Goto Forum:
  


Current Time: Tue Mar 19 06:46:42 GMT 2024

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

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

Back to the top