Fixed synchronization between row AOs and selection manager internal AOI

This commit is contained in:
Andreas Stöckel 2012-03-29 09:15:00 +00:00
parent 02769a962e
commit 596a67e285
2 changed files with 15 additions and 5 deletions

View File

@ -74,17 +74,23 @@ var et2_dataview_selectionManager = Class.extend({
// Handling for Action Implementations updating the state // Handling for Action Implementations updating the state
dummyAOI.doSetState = function (_state) { dummyAOI.doSetState = function (_state) {
if (egwBitIsSet(_state, EGW_AO_STATE_FOCUSED) && !self._inUpdate) if (!self._inUpdate)
{ {
self.resetSelection(); // Update the "focused" flag
self.setFocused(_uid, egwBitIsSet(_state, EGW_AO_STATE_FOCUSED));
// Generally update the state
self._updateState(_uid, _state); self._updateState(_uid, _state);
self.setFocused(_uid, true);
} }
}; };
// Connect the "doTriggerEvent" of the dummy AOI to our internal
// aoi.
dummyAOI.doTriggerEvent = entry.aoi.doTiggerEvent;
// Implementation of the getDOMNode function, so that the event // Implementation of the getDOMNode function, so that the event
// handlers can be properly bound // handlers can be properly bound
dummyAOI.getDOMNode = function () {return _tr}; dummyAOI.getDOMNode = function () { return _tr; };
// Create an action object for the tr and connect it to a dummy AOI // Create an action object for the tr and connect it to a dummy AOI
entry.ao = this._actionObjectManager.addObject(_uid, dummyAOI); entry.ao = this._actionObjectManager.addObject(_uid, dummyAOI);
@ -104,6 +110,8 @@ var et2_dataview_selectionManager = Class.extend({
if (typeof this._registeredRows[_uid] !== "undefined" if (typeof this._registeredRows[_uid] !== "undefined"
&& this._registeredRows[_uid].tr === _tr) && this._registeredRows[_uid].tr === _tr)
{ {
this._inUpdate = true;
this._registeredRows[_uid].tr = null; this._registeredRows[_uid].tr = null;
this._registeredRows[_uid].aoi = null; this._registeredRows[_uid].aoi = null;
@ -118,6 +126,8 @@ var et2_dataview_selectionManager = Class.extend({
{ {
delete this._registeredRows[_uid]; delete this._registeredRows[_uid];
} }
this._inUpdate = false;
} }
}, },

View File

@ -54,7 +54,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(
this._actionManager.setDefaultExecute("javaScript:nm_action"); this._actionManager.setDefaultExecute("javaScript:nm_action");
this._objectManager = new egwActionObjectManager("", this._objectManager = new egwActionObjectManager("",
this._actionManager); this._actionManager, EGW_AO_FLAG_IS_CONTAINER);
} }
else else
{ {