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.
Created attachment 186231 [details] 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.
Created attachment 186620 [details] [diff] [review] first attempt 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+
Created attachment 186623 [details] [diff] [review] comments fixed 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.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.