Last Comment Bug 15232 - persist should be able to remove an attribute from an element
: persist should be able to remove an attribute from an element
Status: NEW
[nsbeta3-]
: helpwanted
Product: Core
Classification: Components
Component: XUL (show other bugs)
: Trunk
: All All
: P3 normal with 3 votes (vote)
: Future
Assigned To: Nobody; OK to take it and work on it
:
: Neil Deakin
Mentors:
Depends on:
Blocks: 251273
  Show dependency treegraph
 
Reported: 1999-09-29 17:48 PDT by hangas
Modified: 2014-10-22 10:16 PDT (History)
19 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description hangas 1999-09-29 17:48:22 PDT
persist should be able to remove an attribute from an element.  Currently persist
saves the value of an attribute to the localstore.rdf file only if there is an
attribute.  We need a way to save the fact that there is no attribute so that
when the document is built the next time it can remove an attribute that is set
by default in the XUL.  We currently use checked="true" on menu items that must
persist, the problem comes in when we remove this attribute to remove the
checkmark, nothing is saved to the localstore.rdf file, so the next time this
window is displayed it does not get the checked="true" removed from the element.

We need to fix globalOverlay.js when this is fixed, to remove the hack of setting
checked="false".
Comment 1 Chris Waterson 1999-12-04 01:39:59 PST
I suck.
Comment 2 Rann Bar-On 2000-08-17 07:00:59 PDT
any chance of this being done in the near future?  it's really annoying when
trying to create checkbox menuitems that use persist to save their values.  The
only workaround is to use the prefs file, which is really cumbersome.  This will
prevent companies attempting to add menus for their employees from using such
menus, which could be a major problem with acceptence.  Recommend fixing before PR3.
Comment 3 Rann Bar-On 2000-08-21 14:52:16 PDT
nominating nsbeta3, because of above reasons.
Comment 4 Chris Waterson 2000-08-21 16:04:13 PDT
This would be a great feature to have, but I'm not going to be able to get to it
before nsbeta3.
Comment 5 Myk Melez [:myk] [@mykmelez] 2008-06-16 00:39:34 PDT
I no longer see a checked="false" hack in any of the globalOverlay.js files in the repository, but setting autocheck="false" on the menuitem, then manually setting the attribute to "false" when the menuitem is unchecked (i.e. doing menuitem.setAttribute("checked", "false") instead of menuitem.removeAttribute("checked")), correctly hides the checkmark and enables the persistence of that state.

I have added a note about this workaround to the menuitem entry in the XUL reference <http://developer.mozilla.org/en/docs/XUL:menuitem>.
Comment 6 Decathlon 2010-08-18 23:50:45 PDT
> I have added a note about this workaround to the menuitem entry in the XUL
> reference <http://developer.mozilla.org/en/docs/XUL:menuitem>.

https://developer.mozilla.org/en/XUL/menuitem
Comment 7 Ian Nartowicz 2012-09-13 08:51:41 PDT
This works now?  I have a situation where I removed a persisted attribute and it is not present when I start a new session.  The attribute is on a box in my own dialog window and set attributes persist.
Comment 8 Kevin Jones 2014-10-22 10:16:00 PDT
(In reply to Ian Nartowicz from comment #7)
> This works now?  I have a situation where I removed a persisted attribute
> and it is not present when I start a new session.

Any update on this?  I am observing the same thing (persisting of no checked attribute), but I don't want to rely on it until I have verification from the devs.

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