Last Comment Bug 324468 - Error in context node when parent control only uses model
: Error in context node when parent control only uses model
Status: RESOLVED INVALID
:
Product: Core
Classification: Components
Component: XForms (show other bugs)
: Trunk
: All All
: P2 normal (vote)
: ---
Assigned To: aaronr
: Stephen Pride
Mentors:
Depends on:
Blocks: 326372 326373
  Show dependency treegraph
 
Reported: 2006-01-23 17:01 PST by aaronr
Modified: 2006-03-30 01:01 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (2.10 KB, application/xhtml+xml)
2006-01-23 17:02 PST, aaronr
no flags Details
testcase (better, imho) (1.75 KB, application/xhtml+xml)
2006-02-03 02:27 PST, Allan Beaufour
no flags Details

Description aaronr 2006-01-23 17:01:35 PST
Assume that you have a control contained inside a repeat or a group.  The repeat/group are bound to the default instance in the default model  The control contains no @ref or @bind.  So the control should pick up its context from the repeat/group.  Now assume that there is @model on the control and the value is also the default model.  Having the model attribute on the control will result in the context of the control going from the same context as the repeat/group to being the root node in the default instance document under the model.

So, in short, having an explicit @model on a control will cause us to cease looking up our ancestor tree for our context node, even when the explicit model value is the same as the implicit model value of the containing element above it.

Confused?  Probably.  :)  Check out the testcase to really see what I mean.  We behave differently than formsPlayer.  You can probably make the argument that what we do is right, but in that case a repeat with a single node in its nodeset and a group binding to the same single node should look the same yet they don't in this testcase.
Comment 1 aaronr 2006-01-23 17:02:08 PST
Created attachment 209413 [details]
testcase
Comment 2 aaronr 2006-01-23 17:03:00 PST
(In reply to comment #1)
> Created an attachment (id=209413) [edit]
> testcase
> 

Note that while the label for the trigger inside the repeat will resolve to ESPN, it will send you to volleyball.org.
Comment 3 Allan Beaufour 2006-02-03 02:25:07 PST
Yes, something seems wrong, but it took me a while to figure out your testcase, etc. I was not less confused...
Comment 4 Allan Beaufour 2006-02-03 02:27:37 PST
Created attachment 210567 [details]
testcase (better, imho)
Comment 5 Allan Beaufour 2006-03-27 06:56:50 PST
(In reply to comment #0)
> Assume that you have a control contained inside a repeat or a group.  The
> repeat/group are bound to the default instance in the default model  The
> control contains no @ref or @bind.  So the control should pick up its context
> from the repeat/group.  Now assume that there is @model on the control and the
> value is also the default model.  Having the model attribute on the control
> will result in the context of the control going from the same context as the
> repeat/group to being the root node in the default instance document under the
> model.

I've just re-read the spec. In section 3.2.3, it states: "One of ref or bind is required." So actually, having only @model is illegal.

I'm not saying that I agree though. I think it could be useful to f.x. use a group to specify the model for its child controls. But for now, the testcase is actually invalid.
Comment 6 Allan Beaufour 2006-03-30 01:01:04 PST
Ok, with 1.0 closed and 1.1 probably also, this will take some time to be valid -- if ever. So this is invalid.

Note You need to log in before you can comment on or make changes to this bug.