import com.itmill.toolkit.ui.Panel;
import com.itmill.toolkit.ui.PopupDateField;
import com.itmill.toolkit.ui.ProgressIndicator;
+import com.itmill.toolkit.ui.RichTextArea;
import com.itmill.toolkit.ui.Select;
import com.itmill.toolkit.ui.TabSheet;
import com.itmill.toolkit.ui.Table;
"window/multiple", "classresource", "usererror",
"progress/window", "progress/thread", "progress",
"customlayout", "spacing", "margin", "clientinfo",
- "fillinform/templates", "notification", "print"};
+ "fillinform/templates", "notification", "print",
+ "richtextfield"};
for (int i = 0; i < examples.length; i++) {
main.addComponent(new Label("<a href='" + context.toString() +
examples[i] + "'>" + examples[i] + "</a>",
example_Notification(main, param);
} else if (example.equals("print")) {
example_Print(main, param);
+ } else if (example.equals("richtextfield")) {
+ example_RichTextField(main, param);
} else {
; // main.addComponent(new Label("Unknown test '"+example+"'."));
}
//main.addComponent(new Label("<p>Print this!</p>\n<script type='text/javascript'>print();</script>", Label.CONTENT_XHTML));
}
+
+ void example_RichTextField(final Window main, String param) {
+ // Create the rich text area
+ final RichTextArea rtarea = new RichTextArea();
+
+ // Set initial content as HTML
+ rtarea.setValue("<h1>Hello</h1>\n<p>This contains some text.</p>");
+
+ // Show the text edited in the rich text area as HTML.
+ final Button show = new Button("Show HTML");
+ final Label html = new Label((String) rtarea.getValue());
+ show.addListener(new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ html.setValue(rtarea.getValue());
+ }
+ });
+
+ main.addComponent(rtarea);
+ main.addComponent(show);
+ main.addComponent(html);
+ }
}
OrderedLayout.ORIENTATION_HORIZONTAL);
// The Commit button calls form.commit().
- Button commit = new Button("Commit");
- commit.addListener(new Button.ClickListener() {
+ Button commit = new Button("Commit", form, "commit");
+ /*commit.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
form.setValidationVisible(true);
form.commit();
}
- });
+ });*/
// The Discard button calls form.discard().
Button discard = new Button("Discard", form, "discard");