]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/sample/class/org/argeo/ria/sample/Applet.js
2 * A simple Hello World applet for documentation purpose.
3 * The only associated command is the "Close" command.
5 qx
.Class
.define("org.argeo.ria.sample.Applet",
7 extend
: qx
.ui
.container
.Composite
,
8 implement
: [org
.argeo
.ria
.components
.IView
],
10 construct : function(){
12 this.setLayout(new qx
.ui
.layout
.VBox());
13 this.passedStatus
= "PASSED";
14 this.failedStatus
= "FAILED";
20 * The viewPane inside which this applet is added.
26 * Commands definition, see {@link org.argeo.ria.event.CommandsManager#definitions}
31 label
: "Close Result",
32 icon
: "resource/slc/window-close.png",
33 shortcut
: "Control+w",
37 callback : function(e
){
38 // Call service to delete
39 this.getView().empty();
47 check
:"org.argeo.ria.components.ViewSelection"
49 instanceId
: {init
:"Hello Applet"},
50 instanceLabel
: {init
:"Hello"}
57 * Called at applet creation. Just registers viewPane.
58 * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane.
60 init : function(viewPane
, data
){
61 this.setView(viewPane
);
62 this.setViewSelection(new org
.argeo
.ria
.components
.ViewSelection(viewPane
.getViewId()));
64 this.setInstanceId(data
[0]);
65 this.setInstanceLabel("Hello applet #"+data
[0]);
69 * Load a given row : the data passed must be a simple data array.
70 * @param data {Element} The text xml description.
73 this.createHtmlGui("<b>Hello World ! Data ID is : "+this.getInstanceId()+"</b>");
76 addScroll : function(){
85 * Create a simple HtmlElement and and insert the html string..
86 * Not used but sample.
87 * @param htmlText {String} Html code to display.
89 createHtmlGui : function(htmlText
){
90 var htmlElement
= new qx
.ui
.embed
.Html(htmlText
);
91 htmlElement
.setOverflowX("auto");
92 htmlElement
.setOverflowY("auto");
93 this.add(htmlElement
, {flex
:1});