Closed Bug 331081 Opened 19 years ago Closed 19 years ago

Nested repeats are not working on trunk

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: allan, Assigned: smaug)

References

Details

(Keywords: fixed1.8.0.4, fixed1.8.1)

Attachments

(3 files, 1 obsolete file)

Something has messed up nested repeats on trunk.
Attached file Testcase (deleted) —
Try clicking on f.x. the input with "Value 1.1.1" in it, the inner-most repeat index is not set right. Then clicking on "Value 2.1.1" the second level is not set right either :(
I just tried to run our trunk code on 1_8_0, and it works fine there. So this is confirmed only on trunk. Is it the good old event rewrite? :)
Summary: Nested repeat are not working on trunk → Nested repeats are not working on trunk
Attached patch bizarre patch (obsolete) (deleted) — Splinter Review
This is a bit strange fix, I know. But it fixes the bug, or at least the test case seems to work in 1.8 and 1.9 with the patch.
Assignee: aaronr → smaug
Status: NEW → ASSIGNED
Attachment #216781 - Flags: review?(allan)
I could ofc use 1_8 / 1_8_0 macros too, if I just find the right ones somewhere ;)
(In reply to comment #4) > I could ofc use 1_8 / 1_8_0 macros too, if I just find the right ones somewhere > ;) > But I really would like to use the same code in branch and trunk if possible.
(In reply to comment #5) > (In reply to comment #4) > > I could ofc use 1_8 / 1_8_0 macros too, if I just find the right ones somewhere > > ;) > > > But I really would like to use the same code in branch and trunk if possible. Yes, please, but if it is not possible, it is not possible. I have to look at the patch next week -- I skimmed it, and yes, it's "bizarre" :|
(In reply to comment #6) > > Yes, please, but if it is not possible, it is not possible. I have to look at > the patch next week -- I skimmed it, and yes, it's "bizarre" :| > Well, the patch shows that it is possible. The "bizarreness" comes from the way how a DOM event is used to create a "stack" of contextcontainer. The code itself is ok, IMO. I've never used events for such thing but I actually like the idea. Events code is anyway pretty much the only way to access all the nodes in the document (normal, anonymous and native anonymous).
Attached patch proposed patch (deleted) — Splinter Review
A better patch. Works in branch and trunk.
Attachment #216781 - Attachment is obsolete: true
Attachment #216896 - Flags: review?(allan)
Attachment #216781 - Flags: review?(allan)
Attachment #216896 - Flags: review?(aaronr)
(In reply to comment #8) > Created an attachment (id=216896) [edit] > proposed patch > > A better patch. Works in branch and trunk. It needs comments. What exactly are you doing? You handle DOMFocusIn in a context container by creating the entire parent-chain and then call setIndex() on all parent repeat from the bottom and up? (We really need to refactor that repeat code)
(In reply to comment #9) > (In reply to comment #8) > > Created an attachment (id=216896) [edit] > > proposed patch > > > > A better patch. Works in branch and trunk. > > It needs comments. What exactly are you doing? > > You handle DOMFocusIn in a context container by creating the entire > parent-chain and then call setIndex() on all parent repeat from the bottom and > up? Yes. That happens currently in the branch, but not explicitly, but because of the way HandleDefault works (HandleDefault is called when returning from the event handling recursion). I'm making that exclicit, so that it works also with new event handling code (which isn't using recursion, but a loop in this case). > > (We really need to refactor that repeat code) Yes ;)
Comment on attachment 216896 [details] [diff] [review] proposed patch Yes, please add comments as Allan mentioned. Also, please add NS_ENSURE_ARG(aContextPosition) to nsXFormsContextContainer::GetContextPosition() since it is accessible via interface. The code makes sense, though. With those, r=me
Attachment #216896 - Flags: review?(aaronr) → review+
Comment on attachment 216896 [details] [diff] [review] proposed patch (In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #8) > > > Created an attachment (id=216896) [edit] > > > proposed patch > > > > > > A better patch. Works in branch and trunk. > > > > It needs comments. What exactly are you doing? > > > > You handle DOMFocusIn in a context container by creating the entire > > parent-chain and then call setIndex() on all parent repeat from the bottom and > > up? > > Yes. That happens currently in the branch, but not explicitly, but because of > the way HandleDefault works (HandleDefault is called when returning from the > event handling recursion). I'm making that exclicit, so that it works also > with new event handling code (which isn't using recursion, but a loop in this > case). With an explanation of this in the code, r=me
Attachment #216896 - Flags: review?(allan) → review+
Attached patch to be checked in (deleted) — Splinter Review
Checking in nsIXFormsRepeatItemElement.idl; /cvsroot/mozilla/extensions/xforms/nsIXFormsRepeatItemElement.idl,v <-- nsIXFormsRepeatItemElement.idl new revision: 1.2; previous revision: 1.1 done Checking in nsXFormsContextContainer.cpp; /cvsroot/mozilla/extensions/xforms/nsXFormsContextContainer.cpp,v <-- nsXFormsContextContainer.cpp new revision: 1.19; previous revision: 1.18 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Blocks: 332853
Whiteboard: xf-to-branch
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: