|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 |
|
5 <!-- |
|
6 storage listbox with multiqueries |
|
7 --> |
|
8 |
|
9 <window title="XUL Template Tests" width="500" height="600" |
|
10 onload="test_template();" |
|
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
12 <script type="application/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
14 |
|
15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
|
16 |
|
17 <data id="output"> |
|
18 <listitem anyid="true" label="Mammal: African Elephant"/> |
|
19 <listitem anyid="true" label="Mammal: Gorilla" style="font-weight:bold"/> |
|
20 <listitem anyid="true" label="Mammal: HIPPOPOTAMUS"/> |
|
21 <listitem anyid="true" label="Mammal: LAMA"/> |
|
22 <listitem anyid="true" label="Mammal: Lion"/> |
|
23 <listitem anyid="true" label="Mammal: Nine-banded Armadillo" style="font-weight:bold"/> |
|
24 <listitem anyid="true" label="Mammal: Polar Bear"/> |
|
25 <listitem anyid="true" label="Mammal: aardvark"/> |
|
26 <listitem anyid="true" label="Bird: Barn Owl" style="font-style:italic"/> |
|
27 <listitem anyid="true" label="Bird: Emu"/> |
|
28 <listitem anyid="true" label="Bird: Raven"/> |
|
29 </data> |
|
30 |
|
31 <script src="templates_shared.js"/> |
|
32 |
|
33 <script> |
|
34 <![CDATA[ |
|
35 SimpleTest.waitForExplicitFinish(); |
|
36 |
|
37 copyToProfile('animals.sqlite'); |
|
38 |
|
39 var testid ="storage listbox with multiqueries"; |
|
40 var queryType = "storage"; |
|
41 var isTreeBuilder = false; |
|
42 var needsOpen = false; |
|
43 var notWorkingYet = false; |
|
44 var notWorkingYetDynamic = false; |
|
45 var expectedOutput = document.getElementById("output"); |
|
46 |
|
47 var changes = []; |
|
48 ]]> |
|
49 </script> |
|
50 |
|
51 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" |
|
52 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
53 <template> |
|
54 <queryset> |
|
55 <query>SELECT * FROM animals WHERE species_id = 5 ORDER BY name</query> |
|
56 <rule> |
|
57 <where subject="?id" rel="greater" value="12"/> |
|
58 <action> |
|
59 <listitem uri="?" label="Mammal: ?name" style="font-weight:bold"/> |
|
60 </action> |
|
61 </rule> |
|
62 <rule> |
|
63 <action> |
|
64 <listitem uri="?" label="Mammal: ?name"/> |
|
65 </action> |
|
66 </rule> |
|
67 </queryset> |
|
68 <queryset> |
|
69 <!-- we use aliases on columns just to have different "column names" in the result set |
|
70 to "similate" a result set from another table for example --> |
|
71 <query>SELECT * FROM animals WHERE species_id = 2 ORDER BY name</query> |
|
72 <rule> |
|
73 <where subject="?id" rel="equals" value="3"/> |
|
74 <action> |
|
75 <listitem uri="?" label="Bird: ?name" style="font-style:italic"/> |
|
76 </action> |
|
77 </rule> |
|
78 <rule> |
|
79 <action> |
|
80 <listitem uri="?" label="Bird: ?name"/> |
|
81 </action> |
|
82 </rule> |
|
83 </queryset> |
|
84 </template> |
|
85 </listbox> |
|
86 </window> |