I am having problems adding checkbox to document. Anything I do, it does not show up.
Here is my code of adding it to run:
- Code: Select all
R run = factory.createR();
CTFFCheckBox checkBox = factory.createCTFFCheckBox();
BooleanDefaultTrue v = new BooleanDefaultTrue();
v.setVal(bool.isValue());
HpsMeasure measure = new HpsMeasure();
measure.setVal(BigInteger.TEN);
checkBox.setChecked(v);
checkBox.setParent(run);
checkBox.setSize(measure);
checkBox.setDefault(v);
JAXBElement<CTFFCheckBox> element = factory.createCTFFDataCheckBox(checkBox);
Text t = factory.createText();
t.setValue("test1");
Text t2 = factory.createText();
t2.setValue("test2");
Text t3 = factory.createText();
t3.setValue("test3");
run.getContent().add(t);
run.getContent().add(t2);
run.getContent().add(element);
run.getContent().add(t3);
return run;
And resulting XML:
- Code: Select all
<w:r>
<w:rPr>
<w:rFonts/>
<w:sz w:val="16"/>
<w:szCs w:val="16"/>
</w:rPr>
<w:t>test1</w:t>
<w:t>test2</w:t>
<w:t>test3</w:t>
</w:r>
Does anyone have had success with creating a CheckBox before? Any help is highly appriciated.