3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
4 <title>qooxdoo
» Demo
</title>
5 <link type=
"text/css" rel=
"stylesheet" href=
"../../resource/css/layout.css"/>
7 <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
9 <script type=
"text/javascript" src=
"../../script/qx.js"></script>
12 <script type=
"text/javascript" src=
"../../script/layout.js"></script>
14 <div id=
"demoDescription">
15 <p>Simple test for qooxdoo's transport implementation using some data for an addressbook.
</p>
16 <p>Using html content in this case.
</p>
19 <script type=
"text/javascript">
20 qx
.core
.Init
.getInstance().defineMain(function()
22 var d
= qx
.ui
.core
.ClientDocument
.getInstance();
24 var lay
= new qx
.ui
.layout
.VerticalBoxLayout
;
25 lay
.setLocation(20, 48);
28 qx
.ui
.core
.ClientDocument
.getInstance().add(lay
);
32 var fsq
= new qx
.ui
.groupbox
.GroupBox("Request");
33 fsq
.setHeight("auto");
37 var hlay
= new qx
.ui
.layout
.HorizontalBoxLayout
;
38 hlay
.setVerticalChildrenAlign("middle");
44 var cm1
= new qx
.ui
.form
.ComboBox();
45 cm1
.add(new qx
.ui
.form
.ListItem("data/persons/anita.html"));
46 cm1
.add(new qx
.ui
.form
.ListItem("data/persons/harald.html"));
47 cm1
.add(new qx
.ui
.form
.ListItem("data/persons/lisbeth.html"));
48 cm1
.add(new qx
.ui
.form
.ListItem("data/persons/paul.html"));
49 cm1
.setSelected(cm1
.getList().getFirstChild());
51 cm1
.addEventListener("changeSelected", upd
);
57 var async
= new qx
.ui
.form
.CheckBox("Async");
58 async
.setChecked(true);
62 var spin
= new qx
.ui
.form
.Spinner(1);
67 var btn
= new qx
.ui
.form
.Button("Send", "icon/16/apply.png");
68 btn
.addEventListener("execute", upd
);
72 var inf
= new qx
.ui
.form
.TextField("State");
74 inf
.setReadOnly(true);
78 var code
= new qx
.ui
.form
.TextField("Code");
80 code
.setReadOnly(true);
84 var typ
= new qx
.ui
.form
.TextField("Type");
86 typ
.setReadOnly(true);
90 var len
= new qx
.ui
.form
.TextField("Length");
92 len
.setReadOnly(true);
96 var checken
= new qx
.ui
.form
.CheckBox("enabled");
97 checken
.setChecked(true);
100 checken
.addEventListener("changeChecked", function(e
) {
101 qx
.io
.remote
.RequestQueue
.getInstance().setEnabled(e
.getData());
108 var fsr
= new qx
.ui
.groupbox
.GroupBox("Result");
112 var area
= new qx
.ui
.embed
.HtmlEmbed(" ");
113 area
.setDimension("100%", "100%");
127 var val
= cm1
.getSelected();
134 for( var i
=0, max
=parseInt(spin
.getValue()); i
<max
; i
++ )
136 req
= new qx
.io
.remote
.Request(val
.getLabel(), "GET", "text/html");
138 req
.setAsynchronous(async
.getChecked());
139 req
.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
141 req
.setParameter("test1", "value1");
142 req
.setParameter("test2", "value2");
143 req
.setParameter("test3", "value3");
145 // Force to testing iframe implementation
146 // req.setCrossDomain(true);
148 req
.addEventListener("sending", function(e
) {
149 inf
.setValue("Sending");
152 req
.addEventListener("receiving", function(e
) {
153 inf
.setValue("Receiving");
156 req
.addEventListener("completed", function(e
)
158 inf
.setValue("Completed");
159 typ
.setValue(e
.getData().getResponseHeader("Content-Type"));
160 len
.setValue(e
.getData().getResponseHeader("Content-Length"));
161 code
.setValue(e
.getData().getStatusCode().toString());
162 area
.setHtml(e
.getData().getContent());
165 req
.addEventListener("failed", function(e
)
167 inf
.setValue("Failed");
168 typ
.setValue(e
.getData().getResponseHeader("Content-Type"));
169 len
.setValue(e
.getData().getResponseHeader("Content-Length"));
170 code
.setValue(e
.getData().getStatusCode().toString());
171 area
.setHtml(e
.getData().getContent());
174 req
.addEventListener("timeout", function(e
)
176 inf
.setValue("Timeout");
177 typ
.setValue(e
.getData().getResponseHeader("Content-Type"));
178 len
.setValue(e
.getData().getResponseHeader("Content-Length"));
179 code
.setValue(e
.getData().getStatusCode().toString());
180 area
.setHtml(e
.getData().getContent());
183 req
.addEventListener("aborted", function(e
)
185 inf
.setValue("Aborted");
186 typ
.setValue(e
.getData().getResponseHeader("Content-Type"));
187 len
.setValue(e
.getData().getResponseHeader("Content-Length"));
188 code
.setValue(e
.getData().getStatusCode().toString());
189 area
.setHtml(e
.getData().getContent());