blob: 4414e53d164bc7f4e5d301124f01ecefe6dd317b [file] [log] [blame]
{{header}}
{{include ../../xfa_catalog_1_0.fragment}}
{{include ../../xfa_object_2_0.fragment}}
{{include ../../xfa_preamble_3_0.fragment}}
{{include ../../xfa_config_4_0.fragment}}
{{object 5 0}} <<
>>
stream
<template>
<subform layout="tb" name="my_doc">
<pageSet id="page" relation="orderedOccurrence">
<occur initial="1" max="1" min="1"/>
<pageArea id="Page1" name="Page1">
<occur max="1" min="1"/>
<contentArea h="100mm" w="200mm" x="0.25in" y="0.25in"/>
</pageArea>
<pageArea id="Page2" name="Page2">
<occur max="1" min="1"/>
<contentArea h="100mm" w="200mm" x="0.25in" y="0.25in"/>
</pageArea>
</pageSet>
<event activity="docReady" ref="$host">
<script contentType="application/x-javascript">
function say(what) {
app.alert(what, "xfa.host says");
}
function testReadProperty(prop) {
try {
var actual = xfa.host[prop];
say("property " + prop + " is " + actual);
} catch (e) {
say("unexpected error: " + e);
}
}
function testROProperty(prop) {
testReadProperty(prop);
try {
xfa.host[prop] = "bogus";
say("error: property " + prop + " was settable");
} catch (e) {
say("expected error setting " + prop + " is " + e);
}
}
function testRWProperty(prop) {
testReadProperty(prop);
try {
xfa.host[prop] = "bogus";
say("property " + prop + " was settable as expected");
} catch (e) {
say("error setting " + prop + " is " + e);
}
}
testROProperty("appType");
testRWProperty("calculationsEnabled");
testRWProperty("currentPage");
testROProperty("language");
testROProperty("name");
testROProperty("numPages");
testROProperty("platform");
testRWProperty("title");
testRWProperty("validationsEnabled");
testROProperty("variation");
testROProperty("version");
try {
xfa.host.beep();
xfa.host.documentCountInBatch();
xfa.host.documentInBatch();
xfa.host.exportData('to-evil-place');
xfa.host.importData('from-good-place');
xfa.host.getFocus();
xfa.host.gotoURL('http://example.com');
xfa.host.setFocus("my_doc.subform_combox_0.combox");
xfa.host.openList("my_doc.subform_combox_0.combox");
} catch (e) {
say("error testing methods: " + e);
}
</script>
</event>
<subform layout="tb" name="subform_combox_0">
<occur initial="1" max="10" min="0" name="occur_subform_combox_0">
</occur>
<field h="10mm" name="combox" w="40mm" x="10mm" y="10mm">
<ui>
<choiceList open="onEntry">
<border>
<edge/>
</border>
</choiceList>
</ui>
<items save="1">
<text>apples</text>
<text>bananas</text>
<text>pears</text>
</items>
<value>
<text>apples</text>
</value>
</field>
</subform>
</subform>
</template>
endstream
endobj
{{include ../../xfa_locale_6_0.fragment}}
{{include ../../xfa_postamble_7_0.fragment}}
{{include ../../xfa_pages_8_0.fragment}}
{{xref}}
{{trailer}}
{{startxref}}
%%EOF