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="subform1"> 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 <medium long="297mm" short="210mm" stock="a4"/> 18 </pageArea> 19 </pageSet> 20 <subform layout="tb" name="subform2"> 21 <occur initial="1" max="10" min="0" name="occur1"> 22 </occur> 23 <field name="field1" h="10mm" w="40mm" x="10mm" y="12mm" border="solid"> 24 <items> 25 <text>and a one</text> 26 <text>and a two</text> 27 </items> 28 <event activity="ready" ref="$form"> 29 <script contentType="application/x-javascript"><![CDATA[ 30 {{include ../expect.js}} 31 {{include ../property_test_helpers.js}} 32 var field = xfa.resolveNode("field1"); 33 testRWProperty(field, "x", "10mm", "11mm"); 34 testRWProperty(field, "y", "12mm", "13mm"); 35 testRWProperty(field, "h", "10mm", "2in"); 36 testRWProperty(field, "w", "40mm", "3in"); 37 testRWProperty(field, "fontColor", "0,0,0", "42,62,4"); 38 testRWProperty(field, "fillColor", "255,255,255", "41,61,11"); 39 testRWProperty(field, "borderColor", "0,0,0", "241,161,11"); 40 // TODO(tsepez): find a way to make this be defined. 41 // testRWProperty(field, "borderWidth", "1", "4"); 42 testRWProperty(field, "mandatory", "disabled", "solid"); 43 testRWProperty(field, "mandatoryMessage", "", "keep out"); 44 testROProperty(field, "dataNode", "[object XFAObject]"); 45 testROProperty(field, "length", 2); 46 47 expectError("field.execInitialize('phooey')"); 48 expect("field.execInitialize()", undefined); 49 50 expectError("field.execEvent()"); 51 expectError("field.execEvent(1, 2)"); 52 expect("field.execEvent('validate')", true); 53 54 expectError("field.deleteItem()"); 55 expectError("field.deleteItem(1, 2)"); 56 expect("field.deleteItem(1)", true); 57 expect("field.deleteItem(137)", true); // silently ignored? 58 59 expectError("field.getSaveItem()"); 60 expectError("field.getSaveItem(1, 2)"); 61 expect("field.getSaveItem(0)", "and a one"); 62 expect("field.getSaveItem(137)", null); 63 64 expectError("field.getItemState()"); 65 expectError("field.getItemState(1, 2)"); 66 expect("field.getItemState(0)", false); 67 expect("field.getItemState(1)", false); 68 expect("field.getItemState(137)", false); 69 expect("field.getItemState(-137)", false); 70 71 expectError("field.setItemState()"); 72 expectError("field.setItemState(1, 2, 3)"); 73 expect("field.setItemState(0, 1)", undefined); 74 expect("field.getItemState(0)", true); 75 expect("field.setItemState(0, 0)", undefined); 76 expect("field.getItemState(0)", false); 77 78 ]]></script> 79 </event> 80 </field> 81 </subform> 82 </subform> 83</template> 84endstream 85endobj 86{{include ../../xfa_locale_6_0.fragment}} 87{{include ../../xfa_postamble_7_0.fragment}} 88{{include ../../xfa_pages_8_0.fragment}} 89{{xref}} 90{{trailer}} 91{{startxref}} 92%%EOF 93