RAP/Custom Widgets FAQ
What is this about?
How is Custom Widget Development different in RAP 2.x?
Compared to RAP 1.x:
- Custom widgets no longer need an LCA.
- Custom widgets no longer have to work with unstable client internals.
- Custom widgets no longer extend existing client widgets.
- Custom widgets now use RemoteObjects to communicate between client and server.
- Custom widgets are now have a stable API (see WebClient Reference in the Develpers Guide) to built on.
- Custom widgets are now only based on HTML/DOM/CSS that is attached to a Composite.
Where can I find a Tutorial
There is no tutorial yet. For now there are the following resources:
- This FAQ
- The DevelopersGuide custom widgets article
- The Reference for Java Remote API
- The Reference for WebClient API.
- The CKEditor example
- This blog post blog post on using Jasmine and custom widgets.
Short answer: This approach does not involve ClientListener, and RWT Scripting does not invlolve HTML or RemoteObjects.
What the two have in common is the Composite client object type. Like any other widget obtained on the client it is a wrapper with SWT-likek API, but also some additional methods (addListener, append, getClientArea, removeListener) specific to creating custom widgets.
How do I port my RAP 1.x Custom Widget to RAP 2.x?
Either you use the new API, in which case your widget is future-proof, or you continue to use LCAs and client internal, in which case you will have to read the client code to figure out what changed, and the widget will not be future-proof.
Obviously we recommend to use the new API, but it is strongly discouraged to somehow mix the two approaches.