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 internal client API.
- Custom widgets no longer extend existing client widgets.
- Custom widgets now use RemoteObjects to communicate between client and server.
- Custom widgets now have a stable API to built on.
- Custom widgets now are only rendered 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-like API, but also some exclusive methods (append, getClientArea, addListener, removeListener) which allow 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, but you will have to write most or all your code. 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.