Need ability to read persisted values (opposite of document.persist())

NEW
Unassigned

Status

()

--
enhancement
9 years ago
6 years ago

People

(Reporter: BenB, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
There's a <xulelement persist="attributename"> and a document.persist() (which stores all values) [1], but no way to read specific stored values back using JS. We need this in a number of places and quite often. See e.g. bug 530047 comment 32, IIRC David Ascher needed it 2 weeks ago, and I also needed it on other projects.

The workaround is to poke around in RDF manually. But that's a) breaking the abstraction and b) all will no longer work when we got rid of RDF.

There should be a simple to use function to retrieve specific stored values, document.retrievePersisted(id, attributename);

Implementation:
bwinton has an implementation at the above cited bug.

[1] https://developer.mozilla.org/en/XUL_Tutorial/Persistent_Data
https://developer.mozilla.org/En/XUL/Attribute/Persist
The latter also mentions document.persist().
You need to log in before you can comment on or make changes to this bug.