Closed Bug 339937 Opened 18 years ago Closed 8 years ago

switch @selected not working inside repeats

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: allan, Unassigned)

References

()

Details

Attachments

(1 file)

2.35 KB, application/xhtml+xml
Details
It seems like the @selected attribute it not obeyed when a switch is inside a repeat.
Attached file Testcase
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.
Depends on: 302497
RIP xforms
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: