Closed Bug 279021 Opened 20 years ago Closed 20 years ago

controls not bound to external instance data

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: aaronr)

Details

Attachments

(3 files)

Binding to data in an external instance document doesn't work.
Attached file shows the problem
both input fields should show names, data brought in from the external instance data.
the externtal instance data
Changed the title to match the problem. The external data _is_ loaded, the problem is that the external instance document is not ready when a control tries to find the context node for a bind in nsXFormsUtils::FindBindContext().
Status: NEW → ASSIGNED
Summary: external instance data doesn't load → controls not bound to external instance data
Attached patch Quick patchSplinter Review
This is kind of hackish... I assume that if a model is returned, its valid even though the node binding fails. That makes the control bind to the model, even though the node binding fails in the first place, and thus it gets bound correctly when it is refreshed after the external instances are loaded.
Attachment #172965 - Flags: review?(smaug)
Attachment #172965 - Flags: review?(smaug) → review+
Comment on attachment 172965 [details] [diff] [review] Quick patch I wonder why this patch hasn't been checked in. (or sr'd) I'd say it is anyway doing the right thing, it is not too hackish.
This patch will work for most cases. But there are a few edge cases, like if the model is AFTER the controls, then it still won't work. If we look at: http://www.w3.org/TR/xforms/index-all.html#evt-revalidate in the 'note:' part, it really makes it sound like we shouldn't bind any controls at all until the xforms-ready is handled. So maybe we should just build a list of controls that need binding to something (i.e. they have single node binding attrs) and then process this list of controls when the document is ready? That would solve other inefficiencies, too, like recalcs that happen before the form is ready. But by doing this, we pretty much give up all hope of allowing the user to start filling in the form while we are loading and, indeed, we could write over whatever the user might fill in early when our bindings finally hit.
(In reply to comment #5) > (From update of attachment 172965 [details] [diff] [review] [edit]) > I wonder why this patch hasn't been checked in. > (or sr'd) > I'd say it is anyway doing the right thing, it is not too hackish. I would say that we check this one in, and then create a "model after controls"-bug.
(In reply to comment #6) > This patch will work for most cases. But there are a few edge cases, like if > the model is AFTER the controls, then it still won't work. You are probably right here. > If we look at: http://www.w3.org/TR/xforms/index-all.html#evt-revalidate in the > 'note:' part, it really makes it sound like we shouldn't bind any controls at > all until the xforms-ready is handled. But probably not here :) xforms-ready is fired when all controls are initialized, after the xforms-model-construct-done event. So xforms-model-construct-done is the correct one to listen to (http://www.w3.org/TR/xforms/slice4.html#evt-modelConstructDone) So as I wrote above: We check this one in and create a new bug, ok?
It is fine with me if this patch goes in. But we still need to worry about: 1) what happens if model is later 2) inefficiencies with recalcs, revalidates, etc. when controls aren't bound, yet. I'll post a bug when I figure out exactly what I mean :=)
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: