Issue 121238 - A bug with form:listbox in OpenOffice Writer
Summary: A bug with form:listbox in OpenOffice Writer
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: Writer
Classification: Application
Component: programming (show other issues)
Version: 3.4.1
Hardware: PC Windows 7
: P3 Critical (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact: Alex
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2012-10-19 16:43 UTC by Jimmy
Modified: 2017-05-20 10:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
an example OpenOffice Writer document (9.38 KB, application/vnd.oasis.opendocument.text)
2012-10-19 16:43 UTC, Jimmy
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Jimmy 2012-10-19 16:43:53 UTC
Created attachment 79794 [details]
an example OpenOffice Writer document

I wrote an XSLT filter that transforms an HTML form into an xForms that is embedded in a writer document (.odt).
In general, it works well. However, there is a bug that I could not fix, which is as follows.

For an HTML listbox control, e.g.,
<select name="deptID">
<option value = "1">Sales</option>
<option value = "2">Production</option>
</select>

I transformed it into an <form:listbox>, e.g.,

<form:listbox form:name="lstbox.deptID" form:id = "ctrl.deptID" xml:id = "xID.deptID"
form:control-implementation = "ooo:com.sun.star.form.component.ListBox"
form:convert-empty-to-null = "true" xforms:bind = "rootBind.deptID"
form:list-source-type = "value-list" form:dropdown = "true" form:size = "20" form:auto-complete = "true">

<form:option form:label = "Sale" form:value="1"/>
<form:option form:label = "Production" form:value="2"/>

<form:properties>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.ListBox"/>
<form:list-property form:property-name="DefaultSelection" office:value-type="float">
</form:list-property>
<form:property form:property-name="MouseWheelBehavior" office:value-type="float" office:value="0"/>
</form:properties>
</form:listbox>

Notice that the <form:listbox> is bound to an XML data element specified by the xforms:bind attribute.

To my understanding, when I selected an entry, e.g., Production, from the listbox in the resulting OpenOffice document,
the bound xml data element should be updated with the corresponding value, e.g., 2. However, the bound xml data element was actually replaced by the label, e.g., Production.

In other words, the value attribute of <form:option> was ignored.

I think this is a bug !!!

-----------------------------------------------------------------
PS:

I copyied the content.xml file of the resulting OpenOffice document (my.odt file) at the end.
After openning the my.odt file in OpenOffice Writer, I selected the entry *** Production *** in the listbox,
and clicked the Submit button, which produced the E:/rootModel.xml file.
The content of the E:/rootModel.xml file was:
<?xml version="1.0" encoding="UTF-8"?>
<instanceData>
<root>
<deptID>Production</deptID>
</root>
</instanceData>

However, to my understanding it should be:
<?xml version="1.0" encoding="UTF-8"?>
<instanceData>
<root>
<deptID>2</deptID>
</root>
</instanceData>


I think this is a bug !!!


------------  content.xml (my.odt is also attached)  -------------------------

<?xml version="1.0" encoding="UTF-8"?>
<office:document-content office:version="1.1" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms">

<office:scripts/>

<office:font-face-decls>
<style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
</office:font-face-decls>

<office:automatic-styles>
<style:style style:name="P1" style:family="paragraph"><style:paragraph-properties fo:text-align="start"/><style:text-properties style:text-line-through-style="none" style:font-name="Arial" fo:font-size="12pt" fo:font-style="normal" style:text-underline-style="none" fo:font-weight="normal"/></style:style><style:style style:name="gr1" style:family="graphic"><style:graphic-properties draw:textarea-vertical-align="middle" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style>
</office:automatic-styles>

<office:body>
<office:text>
<office:forms form:automatic-focus="false" form:apply-design-mode="false">
<xforms:model id="rootModel">
<xforms:instance id="rootInstance">
<instanceData>
<root>
<deptID/>
</root>
</instanceData>
</xforms:instance>

<xforms:bind id="rootBind.deptID" nodeset="root/deptID"/>

<xforms:submission id="submitForm" action="file:///E:/rootModel.xml" method="put" indent="true" omit-xml-declaration="false" standalone="false" replace="none"/>

<xsd:schema/>

</xforms:model>
<form:form form:name="myform" form:apply-filter="true" form:command-type="table" form:control-implementation="ooo:com.sun.star.form.component.Form" office:target-frame="" xlink:href="" xlink:type="simple">

<form:listbox form:name="lstbox.deptID" form:control-implementation="ooo:com.sun.star.form.component.ListBox" xml:id="xmlID.lstbox.deptID" form:id="ctrlID.lstbox.deptID" form:convert-empty-to-null="true" xforms:bind="rootBind.deptID" form:list-source-type="value-list" form:dropdown="true" form:size="20" form:auto-complete="true">

<form:option form:label="Sales" form:value="1"/>
<form:option form:label="Production" form:value="2"/>

<form:properties>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.ListBox"/>
<form:list-property form:property-name="DefaultSelection" office:value-type="float"/>
<form:property form:property-name="MouseWheelBehavior" office:value-type="float" office:value="0"/>
</form:properties>

</form:listbox>

<form:button form:name="PushButton" form:control-implementation="ooo:com.sun.star.form.component.CommandButton" form:id="submittercontrol" form:label="Submit" form:button-type="submit" form:xforms-submission="submitForm">
<form:properties>
<form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.CommandButton"/>
</form:properties>
</form:button>

</form:form>
</office:forms>

<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>

<text:p text:style-name="Standard">
<draw:control draw:style-name="gr1" draw:control="xmlID.lstbox.deptID" svg:y="1.0cm" svg:x="3.5cm" svg:height="1.0cm" svg:width="6.0cm" draw:text-style-name="P1" text:anchor-type="paragraph"/>
<draw:control draw:style-name="gr1" draw:control="submittercontrol" svg:y="2.0cm" svg:x="3.5cm" svg:height="1.0cm" svg:width="2.5cm" draw:text-style-name="P1" text:anchor-type="paragraph"/>
</text:p>

</office:text>
</office:body>
</office:document-content>
Comment 1 Oliver Brinzing 2012-10-21 12:44:19 UTC
.
Comment 2 Edwin Sharp 2014-04-10 12:09:56 UTC
"E:\rootModel.xml is not ready." when select Production and click Submit in attachment 79794 [details]
?

AOO410m16(Build:9762)  -  Rev. 1585426
2014-04-07 10:29:13 (Mo, 07 Apr 2014)
Win 7
Comment 3 Edwin Sharp 2014-04-24 07:49:19 UTC
No info from author.