BinnyG
BinnyG

Reputation: 591

Non-relevant XBL control initialization inside repeat

A XBL control which is bound to a non-relevant node is behaving differently when placed inside a repeat.

Why is xforms-enabled event fired on a non-relevant node inside repeat? init, xforms-enabled and xforms-disabled are called in sequence.

https://gist.github.com/1013671

An example is attached (relevant-error.xhtml). Same control outside repeat works as expected(relevant-without-repeat.xhtml)

Upvotes: 2

Views: 89

Answers (1)

avernet
avernet

Reputation: 31753

This is also happening with a regular xforms:repeat, not involving XBL. When you do an xforms:insert, the subtree of controls corresponding to the nodes you inserted is created right away. At that point, since the binds haven't be re-evaluated yet, the controls are all relevant, hence the xforms-enabled. Then you get an xforms-disabled when the binds are evaluated. Erik took some notes about this, including possible ways in which this could be improved / fixed.

In the meantime, I would make sure that you don't do anything in your code on xforms-enabled that isn't undone on xforms-disabled. If that is the case, then the spurious xforms-enabled and xforms-disabled should not cause a problem, other than unnecessarily slow things down.

Upvotes: 1

Related Questions