In some of the work I have been doing, I have multiple text fields that I've converted to use XStandard within a single form. These fields are sometimes embedded within a collapsible fieldset, or jQuery tabs. Problem is, for whatever reason when the object is hidden it is being deallocated and resetting the values back to the default value for the element (at least in FF3).

Attached is a patch that I used to add in this persistence if an XStandard object is deallocated. Basically, is syncs the editor with the original, hidden field X times per second. I'm not incredibly happy with this as I would much rather trigger on an event, but AFAIK there's no JS event triggered when an object is deallocated.

If there's a better way to doing this (either in method or in JS implementation), please chime in. Multiple XStandard editors on a page is something I would really like to see, but not possible for me unless they can be embedded in a fieldset or tab.

CommentFileSizeAuthor
xstandard_js.patch2.31 KBfractile81

Comments

henrrrik’s picture

Assigned: Unassigned » henrrrik
Status: Needs review » Fixed

Committed. Continuous sync does seem a bit clunky, but it there seems to be a shortage on pretty solutions when working with objects. The JavaScript refactoring was long overdue. Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.