Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "RAP/Custom Widgets FAQ"

< RAP
(New page: == General == === What is this about? === This is an FAQ about HTML/RemoteObject based custom widget development for RAP 2.x (WebClient). For other kinds of custom widgets, see [[RAP/Cust...)
 
(What is this about?)
Line 3: Line 3:
 
=== What is this about? ===
 
=== What is this about? ===
 
This is an FAQ about HTML/RemoteObject based custom widget development for RAP 2.x (WebClient).
 
This is an FAQ about HTML/RemoteObject based custom widget development for RAP 2.x (WebClient).
For other kinds of custom widgets, see [[RAP/Custom_Widgets here]] and [http://www.eclipse.org/rap/developers-guide/devguide.php?topic=custom-widget.html here]
+
For other kinds of custom widgets, see [[RAP/Custom_Widgets]] and [http://www.eclipse.org/rap/developers-guide/devguide.php?topic=custom-widget.html here]
  
 
=== How is Custom Widget Development different in RAP 2.x? ===
 
=== How is Custom Widget Development different in RAP 2.x? ===

Revision as of 05:40, 15 August 2013

General

What is this about?

This is an FAQ about HTML/RemoteObject based custom widget development for RAP 2.x (WebClient). For other kinds of custom widgets, see RAP/Custom_Widgets and here

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:

How is this related to ClientScript/RWT Scripting?

Short answer: This approach does not involve ClientListener, and RWT Scripting does not invlolve HTML or RemoteObjects.

RWT Scripting (formerly known as ClientScripting) is the practice of attaching a piece of JavaScript ("ClientListener") to an existing widget and react to events that it fires. The "widget" object used in RWT Scripting (which can be obtained from the event object or from rap.getObject) are not the internal client widget, but a wrapper with SWT-like API that allows savely interacting with the widget on the client. These wrapper can not be destroyed or created on the client.

It is possible to create custom widgets using the SWT/compound approach and enhance them with RWT Scripting, but this is not what this FAQ is about.

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.

Java

JavaScript

Back to the top