Last Comment Bug 292333 - binds using index() does not work
: binds using index() does not work
Status: RESOLVED WONTFIX
:
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: xforms
: Stephen Pride
:
Mentors:
http://www.mozilla.org/projects/xforms/
Depends on:
Blocks: 326372 326373 376307
  Show dependency treegraph
 
Reported: 2005-04-29 04:25 PDT by Allan Beaufour
Modified: 2016-07-15 14:46 PDT (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Testcase (1.83 KB, application/xhtml+xml)
2005-04-29 04:44 PDT, Allan Beaufour
no flags Details

Description Allan Beaufour 2005-04-29 04:25:35 PDT
As I noted in bug 289534, there's still issues with binds using index(). There
are two:
1) it does not work at initialization (ie. needs a rebuild)

ProcessBind() is run before the repeat elements are constructed (same problem
fixed in bug 291797 for the rest of the controls).

2) changes to repeat-index are not reflected

Bind is not a XForms (UI control) element and does not register as an index
listener as the UI controls (see bug 289534). There are bigger issues with the
bind element though, as it might change the MIPs for instance nodes.

The easy solution (which is also hidden as a suggestion in the spec. somewhere)
is to do a full rebuild, recalc, etc. We might be able to pull it off by
removing the bind MIPs from the MDG, applying them again, and rebuilding the MDG
graph... but I haven't thought too much about it.
Comment 1 Allan Beaufour 2005-04-29 04:44:25 PDT
Created attachment 182157 [details]
Testcase

Here's a testcase showing the bug. It does not work 100% correct before bug
292089 is landed though.
Comment 2 Allan Beaufour 2006-05-31 04:24:14 PDT
(In reply to comment #0)
> 1) it does not work at initialization (ie. needs a rebuild)
> 
> ProcessBind() is run before the repeat elements are constructed (same problem
> fixed in bug 291797 for the rest of the controls).
> 
> 2) changes to repeat-index are not reflected
> 
> Bind is not a XForms (UI control) element and does not register as an index
> listener as the UI controls (see bug 289534). There are bigger issues with the
> bind element though, as it might change the MIPs for instance nodes.
> 
> The easy solution (which is also hidden as a suggestion in the spec. somewhere)
> is to do a full rebuild, recalc, etc. We might be able to pull it off by
> removing the bind MIPs from the MDG, applying them again, and rebuilding the MDG
> graph... but I haven't thought too much about it.

Well, issue 2) is not an issue since binds are static, so they actually only need to update on rebuild (bug 307421).
Comment 3 Allan Beaufour 2006-05-31 04:36:52 PDT
(In reply to comment #0)
> As I noted in bug 289534, there's still issues with binds using index(). There
> are two:
> 1) it does not work at initialization (ie. needs a rebuild)
> 
> ProcessBind() is run before the repeat elements are constructed (same problem
> fixed in bug 291797 for the rest of the controls).

This is still an issue, and it is a bit of a pain:
If a bind is using the index() function in either @nodeset or any of
the MIPs, what should the behaviour be on form load? Is it illegal and
result in an xforms-compute-exception? Or should index() at that point
return 0 or NaN?

The problem is that binds are processed during xforms-model-construct,
but UI is constructed during xforms-model-construct-done.
[http://www.w3.org/TR/2006/REC-xforms-20060314/slice4.html#evt-modelConstruct]

Just finding the repeat, and grabbing the @startindex does not work.
Because the startindex might be higher than the actual size of the
nodeset the repeat is bound to, and 1) it has not been bound yet, and
2) it might be bound using a @bind using an index() function ... ouch.
[http://lists.w3.org/Archives/Public/www-forms/2006May/0177.html]
Comment 4 aaronr 2007-07-02 18:26:55 PDT
We'll definitely need to hold off on xforms-model-construct until the form is loaded (like in the handler for DOMContentLoaded in nsxformsmodelelement).  As long as we do xforms-model-construct before xforms-model-construct-done, this shouldn't cause any grief I don't think.  But probably more to it than that to fix this bug.

I think that this is an important enough bug to fix before we ship 1.0.  Adding it to the 0.9 bug list.
Comment 5 David Bolter [:davidb] 2016-02-04 12:22:09 PST
RIP xforms

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