• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{{header}}
2{{include ../../xfa_catalog_1_0.fragment}}
3{{include ../../xfa_object_2_0.fragment}}
4{{include ../../xfa_preamble_3_0.fragment}}
5{{include ../../xfa_config_4_0.fragment}}
6{{object 5 0}} <<
7  {{streamlen}}
8>>
9stream
10<template>
11  <subform layout="tb" name="my_doc">
12    <pageSet id="page" relation="orderedOccurrence">
13      <occur initial="1" max="1" min="1"/>
14      <pageArea id="Page1" name="Page1">
15        <occur max="1" min="1"/>
16        <contentArea h="100mm" w="200mm" x="0.25in" y="0.25in"/>
17      </pageArea>
18      <pageArea id="Page2" name="Page2">
19        <occur max="1" min="1"/>
20        <contentArea h="100mm" w="200mm" x="0.25in" y="0.25in"/>
21      </pageArea>
22    </pageSet>
23    <event activity="docReady" ref="$host">
24      <script contentType="application/x-javascript">
25        {{include ../expect.js}}
26        {{include ../property_test_helpers.js}}
27        testROProperty(xfa.host, "appType", "Exchange");
28        testRWProperty(xfa.host, "calculationsEnabled", true, false);
29        testRIProperty(xfa.host, "currentPage", -1, 0);
30        testROProperty(xfa.host, "language", "");
31        testROProperty(xfa.host, "name", "Acrobat");
32        testROProperty(xfa.host, "numPages", 2);
33        testROProperty(xfa.host, "platform", "");
34        testRIProperty(xfa.host, "title", "");
35        testRWProperty(xfa.host, "validationsEnabled", true, false);
36        testROProperty(xfa.host, "variation", "Full");
37        testROProperty(xfa.host, "version", "11");
38        app.alert("finished testing properties");
39
40        expectError("xfa.host.beep(1, 1)");
41        expect("xfa.host.beep(42)");
42        expect("xfa.host.beep()");
43
44        expect("xfa.host.documentCountInBatch()", 0);
45        expect("xfa.host.documentCountInBatch(42, 'args', ['ignored'])", 0);
46
47        expect("xfa.host.documentInBatch()", 0);
48        expect("xfa.host.documentInBatch(42, 'args', ['ignored'])", 0);
49
50        expectError("xfa.host.exportData()");
51        expectError("xfa.host.exportData(1, 2, 3)");
52        expect("xfa.host.exportData('to-evil-place')");
53        expect("xfa.host.exportData('to-evil-place', false)");
54
55        expect("xfa.host.getFocus()");
56        expect("xfa.host.getFocus('args', 'ignored')");
57
58        expectError("xfa.host.gotoURL()");
59        expectError("xfa.host.gotoURL(1, 2)");
60        expect("xfa.host.gotoURL('http://example.com')");
61
62        expectError("xfa.host.importData()");
63        expectError("xfa.host.importData(1, 2)");
64        expect("xfa.host.importData('from-good-place')");
65
66        expectError("xfa.host.openList()");
67        expectError("xfa.host.openList(1, 2)");
68        expect("xfa.host.openList('my_doc.subform_combox_0.combox')");
69        expect("xfa.host.openList(eval('my_doc.subform_combox_0'))");
70
71        expect("xfa.host.pageUp()");
72        expect("xfa.host.pageUp('ignored arg')");
73        expect("xfa.host.pageDown()");
74        expect("xfa.host.pageDown('ignored arg')");
75
76        expectError("xfa.host.print(1, 2, 3, 4, 5, 6, 7)");
77        expectError("xfa.host.print(1, 2, 3, 4, 5, 6, 7, 8, 9)");
78        expect("xfa.host.print(true, 1, 1, true, true, true, true, true)");
79
80        expectError("xfa.host.response()");
81        expectError("xfa.host.response(1, 2, 3, 4, 5)");
82        expect("xfa.host.response('Are you sure?', 'Launch Missiles', 'Yes', 1)", "No");
83
84        expectError("xfa.host.setFocus()");
85        expectError("xfa.host.setFocus('one', 'two')");
86        expect("xfa.host.setFocus('my_doc.subform_combox_0')");
87        expect("xfa.host.getFocus()", "[object XFAObject]");
88        expect("xfa.host.setFocus(eval('my_doc.subform_combox_0'))");
89        expect("xfa.host.getFocus()", "[object XFAObject]");
90
91        expectError("xfa.host.resetData(1, 2)");
92        expect("xfa.host.resetData()");
93        expect("xfa.host.resetData('xfa.host')");
94
95        app.alert("finished testing methods");
96      </script>
97    </event>
98    <subform layout="tb" name="subform_combox_0">
99      <occur initial="1" max="10" min="0" name="occur_subform_combox_0">
100      </occur>
101      <field h="10mm" name="combox" w="40mm" x="10mm" y="10mm">
102      </field>
103    </subform>
104  </subform>
105</template>
106endstream
107endobj
108{{include ../../xfa_locale_6_0.fragment}}
109{{include ../../xfa_postamble_7_0.fragment}}
110{{include ../../xfa_pages_8_0.fragment}}
111{{xref}}
112{{trailer}}
113{{startxref}}
114%%EOF
115