Closed Bug 291797 Opened 19 years ago Closed 19 years ago

Controls using index() fail

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: allan, Assigned: allan)

References

()

Details

Attachments

(2 files, 1 obsolete file)

13.96 KB, patch
smaug
: review+
doronr
: review+
Details | Diff | Splinter Review
3.63 KB, application/xhtml+xml
Details
If a controls tries to bind to a node using 'index()' it fails to bind with
these warnings:
WARNING: NS_ENSURE_TRUE(repeatEle) failed, file nsXFormsUtilityService.cpp, line 235
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file XFormsFunctionCall.cpp,
line 207
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file PredicateList.cpp, line 99
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file LocationStep.cpp, line 231
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file nsXPathExpression.cpp,
line 122

I think it is because we start evaluating the expression to soon. If you use
output @value, then it works, but it is also evaluated quite late. I haven't
investigated it further,,,
Attached file Testcase (obsolete) —
Attached patch PatchSplinter Review
Problem was the above. Controls using index() was refering to non-existant
document elements, when they were bound during initialization. I've changed
rebuild, etc. to not bind/refresh controls on initialization, and let
InitializeControls handle both bind and refresh. (This also saves an unneeded
refresh during initialization).

The patch depends on (bug 289534), and also include a leak-fix in
nsXFormsModelElement::Rebuild(): oldFormList was never deleted.
Attachment #181865 - Flags: review?(smaug)
Depends on: 289534
With this patch the test case doesn't seem to work:
I see the following:

bind nodeset='value[index('repeat_id')]' = 
initially it should be == bind nodeset='value[1]' = 1

ref='value[index('repeat_id')]' = 
initially it should be == ref='value[1]' = 1
(In reply to comment #3)
> With this patch the test case doesn't seem to work:
> I see the following:
> 
> bind nodeset='value[index('repeat_id')]' = 
> initially it should be == bind nodeset='value[1]' = 1
> 
> ref='value[index('repeat_id')]' = 
> initially it should be == ref='value[1]' = 1

It's because I'm quite stupid, and has uploaded a testcase with errors in :(
Status: NEW → ASSIGNED
Attached file Testcase wo errors
Argh, I had used 'repeatid' instead of 'repeat_id' in a couple of places in the
other testcase.
Attachment #181767 - Attachment is obsolete: true
Attachment #181865 - Flags: review?(smaug) → review+
Attachment #181865 - Flags: review?(doronr)
Comment on attachment 181865 [details] [diff] [review]
Patch

r=me
Attachment #181865 - Flags: review?(doronr) → review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: