The default bug view has changed. See this FAQ.

output not refreshed due to xpath dependency problem?

RESOLVED FIXED

Status

Core Graveyard
XForms
P2
normal
RESOLVED FIXED
12 years ago
8 months ago

People

(Reporter: aaronr, Assigned: Allan Beaufour)

Tracking

({fixed1.8.0.4, fixed1.8.1})

Trunk
fixed1.8.0.4, fixed1.8.1
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

1.31 KB, application/xhtml+xml
Details
7.90 KB, patch
Doron Rosenberg (IBM)
: review+
aaronr
: review+
Details | Diff | Splinter Review
(Reporter)

Description

12 years ago
Well, I THINK that the summary is right.  I guess Allan will have to tell us if
I've gotten on the wrong track.  If I 'bind' an output to instance data element
using @value="/values/value[1]", the output control won't be refreshed if we do
a xf:setvalue with value="/values/value[1]".  However, if we change both
expressions to be "/values/value", then it will refresh fine.

Output elements don't end up with a mBoundNode since it calls ResetBoundNode
with type = nsIDOMXPathResult::STRING_TYPE instead of evaluating for a node when
it detects @value w/o other binding attributes.  So the output control will
depend on the xpath dependencies that come back during the call to
nsXFormsXPathAnalyzer::Analyze() (called during node binding) to detect when to
rebind and refresh when nsXFormsModelElement::Revalidate is called.  A
dependency node is found when "/values/value" is evaluated, but not when
"/values/value[1]" is called.  So that output control won't detect that it needs
to be refreshed after set value changes the instance node.

I think that I remember problems with output not refreshing correctly if bound
solely with @value but I couldn't find an open bug that seemed to match this.
(Reporter)

Comment 1

12 years ago
Created attachment 183127 [details]
testcase

clicking on the trigger should update the output value from 10 to 20000
(Assignee)

Updated

12 years ago
Priority: -- → P2
Hardware: PC → All
(Reporter)

Updated

11 years ago
Blocks: 326372
(Reporter)

Updated

11 years ago
Blocks: 326373
(Assignee)

Updated

11 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

11 years ago
Created attachment 216410 [details] [diff] [review]
Patch

Problem is that a @value expression has no bound node (because it is STRING_TYPE), so the normal logic of mBoundNode keeping a "reference" to the "single node result" of the XPath expression does not work.

This patch fixes this by letting the XPath Analyzer include the result, if the result type is of STRING_TYPE. This means that for output @value, the single node result is included in the dependencies list, and thus refreshed (rebound) correctly.

(it's been a while since I've ventured down in these files. Oh, are they undocumented, etc... ouch ouch)
Assignee: aaronr → allan
Attachment #216410 - Flags: review?(doronr)

Comment 3

11 years ago
Comment on attachment 216410 [details] [diff] [review]
Patch

fixed the problem
Attachment #216410 - Flags: review?(doronr)
Attachment #216410 - Flags: review?(aaronr)
Attachment #216410 - Flags: review+
(Reporter)

Updated

11 years ago
Attachment #216410 - Flags: review?(aaronr) → review+
(Assignee)

Comment 4

11 years ago
Checked into trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
(Assignee)

Updated

11 years ago
Blocks: 332853
(Assignee)

Updated

11 years ago
Keywords: fixed1.8.0.3, fixed1.8.1
(Assignee)

Updated

11 years ago
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.