Opened 12 years ago

Closed 12 years ago

#3400 closed enhancement (invalid)

dojo.undo should support save-on-exit strategy

Reported by: guest Owned by: Ben Lowery
Priority: high Milestone:
Component: General Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

Currently dojo.undo assumes that I will save my state upon arrival at a hypothetical "page". e.g., I load page B (hypothetically speaking, I really just innerHTML the contents of page B) and then add some info to the undo history to say that I am at page B. Diagrammatically,

page A -> (save A) -----> page B -> (save B) -----> page C -> (save C)

Another approach is to save the state just before I "leave" a page. i.e.,

page A -----> (save A) -> page B -----> (save B) -> page C

I call this the "save-on-exit" method. Dojo currently supports the former strategy and not the latter. The latter makes sense because the kind of state one should want to save is the latest state and not the state of things when you first arrived at the page. For example, if I goto a page and type a bunch of info into a form and then visit another page, if I go back, I would want to see the stuff I entered into the form.

Change History (2)

comment:1 Changed 12 years ago by Adam Peller

Owner: changed from anonymous to Ben Lowery

comment:2 Changed 12 years ago by Ben Lowery

Resolution: invalid
Status: newclosed

dojo.back supports calling addToHistory at any point the programmer deems necessary. You should be able to support either style of state change using the 0.9+ api.

Note: See TracTickets for help on using tickets.