Closed Bug 297692 Opened 20 years ago Closed 20 years ago

Submission in non-default model doesn't work

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: aaronr)

Details

Attachments

(2 files, 1 obsolete file)

If you reference a submission that lives in a non-default model and has no @model or @bind, then the submission won't work. This is because nsXFormsSubmissionElement::GetSelectedInstanceData uses nsXFormsUtils::EvaluateNodeBinding to find the nodeset to submit. However, the rules that EvaluateNodeBinding uses to determine the model to use when resolving the single node binding is not the same rules that submission should use. Submission's default model should be its parent, but for EvaluateNodeBinding the default model is the first model in the xforms document (because that is what controls need). The proper fix is to either put a test in the chain of logic initiated by the call to EvaluateNodeBinding to special case submission element or to do the xpath resolution by hand in the submission element. It really doesn't need a lot of the context node logic, for example, that EvaluateNodeBinding has.
Attached file testcase
Testcase. Both submissions should submit identical looking data. But because of this bug, the submission in the second model won't do anything
Haven't looked too much at it, but an easy fix would be to let the model implement nsIXFormsContextControl. FindParentContext() will then find it.
Attached patch first attempt (obsolete) — Splinter Review
Went with Allan's excellent suggestion. All the logic is in nsXFormsModelElement::GetContext. Just returning the id of the model and the first instance document's root node as the context node.
Attachment #186620 - Flags: review?(doronr)
Comment on attachment 186620 [details] [diff] [review] first attempt Please change it to use NS_ENSURE_TRUE on firstInstanceDoc and comment why without it, we should fail. You probably want to also set the return arguments to their values only if the NS_ENSURE_TRUE succeds.
Attachment #186620 - Flags: review?(doronr) → review+
Attached patch comments fixedSplinter Review
fixed doron's comments. Smaug, can you second review? Doron, please correct any review comments that smaug may have and check this in? Then it won't have to wait until I get back from vacation. Thanks.
Attachment #186620 - Attachment is obsolete: true
Attachment #186623 - Flags: review?(smaug)
Attachment #186623 - Flags: review?(smaug) → review+
Checked in
Status: NEW → 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: