Last Comment Bug 339937 - switch @selected not working inside repeats
: switch @selected not working inside repeats
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: All All
-- normal with 1 vote (vote)
: ---
Assigned To: xforms
: Stephen Pride
Depends on: 302497
  Show dependency treegraph
Reported: 2006-06-01 01:39 PDT by Allan Beaufour
Modified: 2016-07-15 14:46 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Testcase (2.35 KB, application/xhtml+xml)
2006-06-01 01:41 PDT, Allan Beaufour
no flags Details

Description User image Allan Beaufour 2006-06-01 01:39:59 PDT
It seems like the @selected attribute it not obeyed when a switch is inside a repeat.
Comment 1 User image Allan Beaufour 2006-06-01 01:41:03 PDT
Created attachment 224037 [details]
Comment 2 User image aaronr 2008-01-28 15:03:30 PST
Debugged this a bit.  The problem is that switch isn't handling the insertion of cases the best.  And case doesn't handle being inserted well at all.  It only sets its selected state (mCachedSelectedAttr) during DoneAddingChildren which won't get called in the case of repeat templating since it isn't going through the parser.  But to make this work correctly we need to keep in mind the comments in bug 302497 (which, in the end, is probably a duplicate of this bug but we should probably make sure that the testcases for both work when the fix is added).  If the repeat contents of a switch is wiped out and replaced due to a repeat rebuilding (caused by a change in the bound nodeset), we need to remember the currently selected case inside the switch and not just go by @selected on the case.

We should also put a test for repeat state inside nsXFormsSwitchElement::Init() and if it is eType_Template, we shouldn't bother doing any work.
Comment 3 User image David Bolter [:davidb] 2016-02-04 12:21:37 PST
RIP xforms

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