function updateDiff(oControl, aContexts) {
			var aDiff = aContexts.diff,
				aChildren = oControl[oAggregationInfo._sGetter]() || [],
				oDiff, oClone, oContext, i;

			// If no diff exists or aggregation is empty, fall back to default update
			if (!aDiff || aChildren.length === 0) {
				update(oControl, aContexts);
				return;
			}

			// Loop through the diff and apply it
			for (i = 0; i < aDiff.length; i++) {
				oDiff = aDiff[i];
				switch (oDiff.type) {
					case "insert":
						oContext = aContexts[oDiff.index];
						oClone = fnFactory(getIdSuffix(oControl, oDiff.index), oContext);
						oClone.setBindingContext(oContext, oBindingInfo.model);
						oControl[oAggregationInfo._sInsertMutator](oClone, oDiff.index);
						break;
					case "delete":
						oClone = oControl[oAggregationInfo._sRemoveMutator](oDiff.index);
						oClone.destroy("KeepDom");
						break;
					default:
						Log.error("Unknown diff type \"" + oDiff.type + "\"");
				}
			}

			// Loop through all children and set the binding context again. This is needed for
			// indexed contexts, where inserting/deleting entries shifts the index of all following items
			aChildren = oControl[oAggregationInfo._sGetter]() || [];
			for (i = 0; i < aChildren.length; i++) {
				aChildren[i].setBindingContext(aContexts[i], oBindingInfo.model);
			}
		}
// only add/remove children as the data has changed to minimize control updates and rendering
only add/remove children as the data has changed to minimize control updates and rendering
only add / remove children as the data has changed to minimize control updates and rendering
function updateDiff(oControl, aContexts) {
			var aDiff = aContexts.diff,
				aChildren = oControl[oAggregationInfo._sGetter]() || [],
				oDiff, oClone, oContext, i;
			if (!aDiff || aChildren.length === 0) {
				update(oControl, aContexts);
				return;
			}
			for (i = 0; i < aDiff.length; i++) {
				oDiff = aDiff[i];
				switch (oDiff.type) {
					case "insert":
						oContext = aContexts[oDiff.index];
						oClone = fnFactory(getIdSuffix(oControl, oDiff.index), oContext);
						oClone.setBindingContext(oContext, oBindingInfo.model);
						oControl[oAggregationInfo._sInsertMutator](oClone, oDiff.index);
						break;
					case "delete":
						oClone = oControl[oAggregationInfo._sRemoveMutator](oDiff.index);
						oClone.destroy("KeepDom");
						break;
					default:
						Log.error("Unknown diff type \"" + oDiff.type + "\"");
				}
			}
			aChildren = oControl[oAggregationInfo._sGetter]() || [];
			for (i = 0; i < aChildren.length; i++) {
				aChildren[i].setBindingContext(aContexts[i], oBindingInfo.model);
			}
		}
function updateDiff ( oControl , aContexts ) { var aDiff = aContexts . diff , aChildren = oControl [ oAggregationInfo . _sGetter ] ( ) || [ ] , oDiff , oClone , oContext , i ; if ( ! aDiff || aChildren . length === 0 ) { update ( oControl , aContexts ) ; return ; } for ( i = 0 ; i < aDiff . length ; i ++ ) { oDiff = aDiff [ i ] ; switch ( oDiff . type ) { case "insert" : oContext = aContexts [ oDiff . index ] ; oClone = fnFactory ( getIdSuffix ( oControl , oDiff . index ) , oContext ) ; oClone . setBindingContext ( oContext , oBindingInfo . model ) ; oControl [ oAggregationInfo . _sInsertMutator ] ( oClone , oDiff . index ) ; break ; case "delete" : oClone = oControl [ oAggregationInfo . _sRemoveMutator ] ( oDiff . index ) ; oClone . destroy ( "KeepDom" ) ; break ; default : Log . error ( "Unknown diff type \"" + oDiff . type + "\"" ) ; } } aChildren = oControl [ oAggregationInfo . _sGetter ] ( ) || [ ] ; for ( i = 0 ; i < aChildren . length ; i ++ ) { aChildren [ i ] . setBindingContext ( aContexts [ i ] , oBindingInfo . model ) ; } }
only add/remove children as the data has changed to minimize control updates and rendering
only add / remove children as the data has changed to minimize control updates and rendering
// If no diff exists or aggregation is empty, fall back to default update // Loop through the diff and apply it // Loop through all children and set the binding context again. This is needed for // indexed contexts, where inserting/deleting entries shifts the index of all following items