function refreshMapping(oLabel, bDestroy){
		var sLabelId = oLabel.getId();
		var sOldId = oLabel.__sLabeledControl;
		var sNewId = bDestroy ? null : findLabelForControl(oLabel);

		if (sOldId == sNewId) {
			return;
		}

		//Invalidate the label itself (see setLabelFor, setAlternativeLabelFor)
		if (!bDestroy) {
			oLabel.invalidate();
		}

		//Update the label to control mapping (1-1 mapping)
		if (sNewId) {
			oLabel.__sLabeledControl = sNewId;
		} else {
			delete oLabel.__sLabeledControl;
		}

		//Update the control to label mapping (1-n mapping)
		var aLabelsOfControl;
		if (sOldId) {
			aLabelsOfControl = CONTROL_TO_LABELS_MAPPING[sOldId];
			if (aLabelsOfControl) {
				aLabelsOfControl = aLabelsOfControl.filter(function(sCurrentLabelId) {
					  return sCurrentLabelId != sLabelId;
				});
				if (aLabelsOfControl.length) {
					CONTROL_TO_LABELS_MAPPING[sOldId] = aLabelsOfControl;
				} else {
					delete CONTROL_TO_LABELS_MAPPING[sOldId];
				}
			}
		}
		if (sNewId) {
			aLabelsOfControl = CONTROL_TO_LABELS_MAPPING[sNewId] || [];
			aLabelsOfControl.push(sLabelId);
			CONTROL_TO_LABELS_MAPPING[sNewId] = aLabelsOfControl;
		}

		//Invalidate related controls
		var oOldControl = toControl(sOldId, true);
		var oNewControl = toControl(sNewId, true);

		if (oOldControl) {
			oLabel.detachRequiredChange(oOldControl);
		}

		if (oNewControl) {
			oLabel.attachRequiredChange(oNewControl);
		}

	}
function refreshMapping(oLabel, bDestroy){
		var sLabelId = oLabel.getId();
		var sOldId = oLabel.__sLabeledControl;
		var sNewId = bDestroy ? null : findLabelForControl(oLabel);

		if (sOldId == sNewId) {
			return;
		}

		//Invalidate the label itself (see setLabelFor, setAlternativeLabelFor)
		if (!bDestroy) {
			oLabel.invalidate();
		}

		//Update the label to control mapping (1-1 mapping)
		if (sNewId) {
			oLabel.__sLabeledControl = sNewId;
		} else {
			delete oLabel.__sLabeledControl;
		}

		//Update the control to label mapping (1-n mapping)
		var aLabelsOfControl;
		if (sOldId) {
			aLabelsOfControl = CONTROL_TO_LABELS_MAPPING[sOldId];
			if (aLabelsOfControl) {
				aLabelsOfControl = aLabelsOfControl.filter(function(sCurrentLabelId) {
					  return sCurrentLabelId != sLabelId;
				});
				if (aLabelsOfControl.length) {
					CONTROL_TO_LABELS_MAPPING[sOldId] = aLabelsOfControl;
				} else {
					delete CONTROL_TO_LABELS_MAPPING[sOldId];
				}
			}
		}
		if (sNewId) {
			aLabelsOfControl = CONTROL_TO_LABELS_MAPPING[sNewId] || [];
			aLabelsOfControl.push(sLabelId);
			CONTROL_TO_LABELS_MAPPING[sNewId] = aLabelsOfControl;
		}

		//Invalidate related controls
		var oOldControl = toControl(sOldId, true);
		var oNewControl = toControl(sNewId, true);

		if (oOldControl) {
			oLabel.detachRequiredChange(oOldControl);
		}

		if (oNewControl) {
			oLabel.attachRequiredChange(oNewControl);
		}

	}
function refreshMapping ( oLabel , bDestroy ) { var sLabelId = oLabel . getId ( ) ; var sOldId = oLabel . __sLabeledControl ; var sNewId = bDestroy ? null : findLabelForControl ( oLabel ) ; if ( sOldId == sNewId ) { return ; } //Invalidate the label itself (see setLabelFor, setAlternativeLabelFor) if ( ! bDestroy ) { oLabel . invalidate ( ) ; } //Update the label to control mapping (1-1 mapping) if ( sNewId ) { oLabel . __sLabeledControl = sNewId ; } else { delete oLabel . __sLabeledControl ; } //Update the control to label mapping (1-n mapping) var aLabelsOfControl ; if ( sOldId ) { aLabelsOfControl = CONTROL_TO_LABELS_MAPPING [ sOldId ] ; if ( aLabelsOfControl ) { aLabelsOfControl = aLabelsOfControl . filter ( function ( sCurrentLabelId ) { return sCurrentLabelId != sLabelId ; } ) ; if ( aLabelsOfControl . length ) { CONTROL_TO_LABELS_MAPPING [ sOldId ] = aLabelsOfControl ; } else { delete CONTROL_TO_LABELS_MAPPING [ sOldId ] ; } } } if ( sNewId ) { aLabelsOfControl = CONTROL_TO_LABELS_MAPPING [ sNewId ] || [ ] ; aLabelsOfControl . push ( sLabelId ) ; CONTROL_TO_LABELS_MAPPING [ sNewId ] = aLabelsOfControl ; } //Invalidate related controls var oOldControl = toControl ( sOldId , true ) ; var oNewControl = toControl ( sNewId , true ) ; if ( oOldControl ) { oLabel . detachRequiredChange ( oOldControl ) ; } if ( oNewControl ) { oLabel . attachRequiredChange ( oNewControl ) ; } }
Updates the mapping tables for the given label, in destroy case only a cleanup is done
Updates the mapping tables for the given label in destroy case only a cleanup is done
Refreshes the mapping of the control to the old control