Community
Participate
Working Groups
Build Identifier: M20110909-1335 I'm trying to use a twistie in a Form. My project uses following packages in the build path: org.eclipse.rap.rwt_1.5.0.20110920-2112.jar org.eclipse.rap.jface_1.5.0.20110920-2112.jar org.eclipse.rap.ui.forms_1.5.0.20110920-2112.jar org.eclipse.core.commands_3.6.0.I20110111-0800.jar org.eclipse.equinox.common_3.6.0.v20110523.jar Whenever I use the Twistie in the project, the browser shows following error messages: Could not evaluate javascript respon (more details in the attachment) Reproducible: Always Steps to Reproduce: A minimal example should be: --<8-- import org.eclipse.rwt.lifecycle.IEntryPoint; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.forms.widgets.Twistie; public class TwistieBug implements IEntryPoint { @Override public int createUI() { Display display = new Display(); Shell shell = new Shell( display, 0 ); shell.setLayout(new FillLayout()); Twistie tw = new Twistie(shell, 0); shell.setMaximized(true); shell.layout(); shell.open(); while( !shell.isDisposed() ) { if( !display.readAndDispatch() ) display.sleep(); } display.dispose(); return 0; } } --8>--
Created attachment 204080 [details] The contents of the browser window after executing TwistieBug.java
Note that this also happens with the components of RAP 1.4.0. In my Form, I want to use a Section with a Twistie. I traced the problem back to the Twistie code (happens also for TreeNode) hence the minimal example.
Sebastian, I can't reproduce it (tested on Windows with FF 7, IE9, Chrome 14, Safari 5.1) and I can't find such a property "forms" in our code. Do you have a custom widgets or other custom javascript? Is it reproducible in all browsers - FF, IE, Chrome, Safari?
I tested it on Chrome 12 and Iceweasel 6 on Debian and the behaviour is essentially the same. I don't know so much about internals of RAP so I have no idea how to debug this to get better information :( I create a new Java project, add the Twistie.java to it and configure the build path to contain the mentioned jar files. Then I run the Twistie.java as RWT application and I get the error message I mentioned. If I comment out the Twistie, the application runs fine. I'll try on a Windows machine later.
Created attachment 204092 [details] Browser output of IceWeasel I was slightly inprecise. The output differs in the error message. In IceWeasel, it is complained that org.eclipse.ui is undefined. Did I forget to add a particular jar (apart from those I mentioned)?
Sebastian, if I understand correctly you create and run a RAP standalone application. As stated in this newsgroup post: http://www.eclipse.org/forums/index.php/mv/msg/40085/130447/#msg_130447 "...forms plug-in is intended to work with RAP, but not RWT standalone, it makes use of the resource extension point. You could try to register these resources manually. Have a look at the resources extensions in the plugin.xml." I will close this bug as INVALID.
Yes, seems to be worth a FAQ if you ask me :)
(In reply to comment #7) > Yes, seems to be worth a FAQ if you ask me :) You are welcome to contribute an entry to the FAQ :) IIRC RCP Forms can be used without OSGi and the plug-in registry running, which would mean that itis a bug in RAP Forms if it can't be used standalone.
I'd love to do this, but I did not bring the described procedure to actually do something useful. Seems that this information in the forum entry is outdated (I cannot really overload the RWTServletContextListener because most of the useful methods are private). However, I figured out that there is a org.eclipse.rwt.Configurator parameter, which I can use in web.xml to register a org.eclipse.rwt.engine.Configurator implementation, in which I can add the widgets. But this doesn't work too (same error message appears). From the point of view what the Form UI provides, I don't see a reason why this shall depend on RAP, but then, I'm no expert of the Eclipse framework. Never used RCP forms before, but if they work without the registry I think this Bug is valid.
Got it now. The key was also to use context.addResource(new ToggleHyperlinkResource()); to the configure() implementation, so the corresponding javascript is "linked" in. I may provide a FAQ entry now.
(In reply to comment #10) > Got it now. The key was also to use > context.addResource(new ToggleHyperlinkResource()); > to the configure() implementation, so the corresponding javascript is "linked" Great! > in. I may provide a FAQ entry now. The FAQ is here: http://wiki.eclipse.org/RAP/FAQ, you can log in with your bugzilla account.