Closed Bug 290253 Opened 20 years ago Closed 20 years ago

A repeat won't reflect instance nodes added by script

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: allan)

Details

Attachments

(4 files)

If you use javascript to add another instance node to the instance document that
matches a nodeset specified on a repeat and then rebuild, recalculate,
revalidate and refresh the model, the repeat still won't be updated.  This works
on formsPlayer and the Novell plugin.

With my quick debug, it looks like this is probably caused because
mControlsNeedingRefresh gets cleared by rebuild so the nsXFormsRepeatElement
won't refresh, even though it rebinds.
after the page loads, click on the button labeled, "click on me to insert a new
node into the instance data".  This will instert a node with a value of 3000 as
the first child of the root element contained in the instance document used by
this repeat element.
Attached file Simpler testcase
I haven't investigated it further, but here's a simpified version of the
testcase.
Ahem, I could possibly start by fixing insert/delete functionality first :)

My guess is that either bug 278368 or bug 284469 is to blame.
Attached file insert example
Does not work either...
Attachment #180700 - Attachment is patch: false
Attachment #180700 - Attachment mime type: text/plain → application/xhtml+xml
Attached patch PatchSplinter Review
Two problems:
1) Repeats were not bound to the model
2) Rebuild needed to trigger a refresh of everything
Assignee: aaronr → allan
Status: NEW → ASSIGNED
Attachment #180716 - Flags: review?(smaug)
Comment on attachment 180716 [details] [diff] [review]
Patch


>-    mDocumentLoaded(PR_FALSE)
>+    mDocumentLoaded(PR_FALSE),
>+    mJustRebuilt(PR_FALSE)

Maybe call this mNeedsRefresh

Other than that, looks ok.
r=me
Attachment #180716 - Flags: review?(smaug) → review+
Nice!  With smaug's nit included, r=me
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 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: