Issue 36605 - [CWS eforms2] "Read Only" setting of an binding not properly propagated to the control
Summary: [CWS eforms2] "Read Only" setting of an binding not properly propagated to th...
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: marc.neumann
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-03 15:28 UTC by Frank Schönheit
Modified: 2013-08-07 14:41 UTC (History)
1 user (show)

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


Attachments
document to reproduce the bug case (7.34 KB, application/octet-stream)
2004-11-03 15:31 UTC, Frank Schönheit
no flags Details
document to reproduce the bug case (7.24 KB, application/octet-stream)
2004-12-22 14:47 UTC, Frank Schönheit
no flags Details
changed mime-type of test document (7.22 KB, application/vnd.sun.xml.writer)
2005-01-21 11:04 UTC, mbu
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2004-11-03 15:28:47 UTC
open the attached bug doc
It contains two text controls, bound to an XML element resp. one of its
attributes (address and address/@city).
Additionally, it contains a checkbox, which is bound to control/@readonly, a
boolean attribute of another element.
Additionally, the "Readonly" property of the address binding is set to
"/instanceData/control/@readOnly". You can see this when editing the binding
properties in the data navigator, or when opening the property browser for the
"address" text field
on the "Data" tab page.

So, as a result, you would expect that the "address" text field is readonly if
and only if the check box is checked, while the "address/@city" text field is
never readonly.

Switch off the design mode. Try to enter text in either of the two controls =>
this doesn't work. Obviously both controls are readonly. This does not depend on
the check box state at all - no matter whether it's checked or not, both
controls are readonly all the time.
Comment 1 Frank Schönheit 2004-11-03 15:31:04 UTC
Created attachment 18884 [details]
document to reproduce the bug case
Comment 2 openoffice 2004-11-08 19:57:16 UTC
dvo: Two problems:

1) XAttribute::setNodeValue doesn't notify any changes, and therefore the XForms
model doesn't get any notice that something has changed. I have a patch for
this, but can't currently commit due to the ongoing resync.

2) According to the XForms/XPath standard, the expression evaluations to a
node-set. A node-set interpreted as a boolean is true if (and only if) the
node-set it not empty. In other words, the given expression tests whether the
attribute is present (which it always is), and not whether its string value is
'true'. To do so, use the boolean-from-string(..) function defined in XPath.
Probably surprising, but unfortunately true. 
Comment 3 openoffice 2004-12-10 11:06:50 UTC
dvo->mbu: Please have a look at this.
Comment 4 mbu 2004-12-21 10:30:50 UTC
issue resolved,added MIP propagation to /forms/xforms/binding.cxx - distributeMIP().
note that the bugdoc itself does not work as expected because the
binding-expression for the readonly-condition should read
'boolean-from-string(/instanceData/control/@readonly)'. see
http://www.w3.org/TR/2002/WD-xforms-20020118/slice7.html for further informations.
Comment 5 Frank Schönheit 2004-12-22 14:47:05 UTC
Created attachment 20771 [details]
document to reproduce the bug case
Comment 6 Frank Schönheit 2004-12-22 14:48:38 UTC
I attached a new (XForms conformant) document to ease verification of the fix
Comment 7 mbu 2005-01-21 11:04:35 UTC
Created attachment 21749 [details]
changed mime-type of test document
Comment 8 mbu 2005-01-21 11:23:54 UTC
reopen to assign to QA
Comment 9 mbu 2005-01-21 11:38:22 UTC
please verify.
Comment 10 thorsten.ziehm 2005-02-02 14:18:22 UTC
set to state 'resolved/fixed'
Comment 11 marc.neumann 2005-03-11 10:48:48 UTC
verified in cws eforms4
Comment 12 marc.neumann 2005-04-08 13:01:03 UTC
Hi,

fixed in current developer build -> close.
The current developer build can be found at
http://download.openoffice.org/680/index.html
Feel free to reopen if this issue is not fixed in the developer build.

Bye Marc