Closed
Bug 297692
Opened 20 years ago
Closed 20 years ago
Submission in non-default model doesn't work
Categories
(Core Graveyard :: XForms, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aaronr, Assigned: aaronr)
Details
Attachments
(2 files, 1 obsolete file)
|
1.67 KB,
application/xhtml+xml
|
Details | |
|
5.49 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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.
Testcase. Both submissions should submit identical looking data. But because
of this bug, the submission in the second model won't do anything
Comment 2•20 years ago
|
||
Haven't looked too much at it, but an easy fix would be to let the model
implement nsIXFormsContextControl. FindParentContext() will then find it.
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 4•20 years ago
|
||
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+
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)
Updated•20 years ago
|
Attachment #186623 -
Flags: review?(smaug) → review+
Comment 6•20 years ago
|
||
Checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•