Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#505 closed enhancement (fixed)

I can't undo change when the newValue is not correct.(dojo.widget.InlineEditBox)

Reported by: [email protected] Owned by: tk
Priority: high Milestone:
Component: Widgets Version: 0.2
Keywords: Cc: [email protected]…, [email protected]
Blocked By: Blocking:


when i use dojo.widget.InlineEditBox?,I want undo change in onSave() when the "newValue" is not correct. but i can't.

saveEdit: function(e){
    var ee = this[this.mode.toLowerCase()];
    if((this.textValue != ee.value)&&
	(dojo.string.trim(ee.value) != "")){
	this.doFade = true;
	this.onSave(ee.value, this.textValue);
        //invoke undo() in onSave() can't do anything!!!
	this.textValue = ee.value;
	this.editable.innerHTML = this.textValue;
	this.doFade = false;

maybe it should be like this:

var oldValue = this.textValue;
var newValue = ee.value;			
this.textValue = newValue;
this.editable.innerHTML = newValue;
this.onSave(newValue, oldValue);
//invoke undo() in onSave() can make editable.innerHTML be the oldValue

Change History (5)

comment:1 Changed 16 years ago by dylan

Milestone: 0.4
Owner: changed from anonymous to dylan
Status: newassigned

comment:2 Changed 16 years ago by dylan

Owner: changed from dylan to tk
Status: assignednew

comment:3 Changed 16 years ago by Karl Tiedt

Resolution: fixed
Status: newclosed

(In [5789]) Fixes #505 onSave now passes newValue, oldValue, so saveHandlers can pass data as if it was from a form, and added call to this.onSave() from this.Undo() to give saveHandlers an opportunity to undo changes as well.

comment:4 Changed 16 years ago by tk

Just for reference:

this.undo() now calls this.onSave() just like SaveEdit?() does, thus giving you an opportunity to resave your old data.

Also include the Name of the input area as an argument to onSave now as well.


(this is mainly so I know the submitter gets notified of this ticket change)

comment:5 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.