function _initializeSearchField(bAsync) {

		if (bAsync) {
			if (!this._iSearchFieldTimer) {
				this._iSearchFieldTimer = setTimeout(function() {
					this._iSearchFieldTimer = undefined;
					_initializeSearchField.call(this, false);
				}.bind(this), 0);
			}
			return;
		} else if (this._iSearchFieldTimer) { // in case of a pending timeOut but sync calling, skip pending timeout
			clearTimeout(this._iSearchFieldTimer);
			this._iSearchFieldTimer = null;
		}

		var sFilterFields = this.getFilterFields();
		var oWrapper = _getWrapper.call(this, false); // without content it makes no sense to have a SearchField

		if (sFilterFields && oWrapper) {
			var oFilterBar = this._getFilterBar();

			if (!oFilterBar) {
				oFilterBar = new FilterBar(this.getId() + "-FB", {
					liveMode: !oWrapper.isSuspended(), // if suspended, no live search
					showGoButton: false
				});
				oFilterBar.setInternalConditions(this._oConditions); // if already InParameter or SearchValue set, move it to FilterBar
				this._oConditions = {};
				this.setAggregation("_filterBar", oFilterBar, true);
			}

			if (!oFilterBar.getBasicSearchField()) {
				if (!this._oSearchField) { // reuse SearchField if just FilterBar switched (CollectiveSearch case)
					this._oSearchField = new FilterField(this.getId() + "-search", {
						conditions: "{$filters>/conditions/" + sFilterFields + "}",
						placeholder:"{$i18n>filterbar.SEARCH}",
						label:"{$i18n>filterbar.SEARCH}", // TODO: do we want a label?
						maxConditions: 1,
						width: "50%"
					});
					this._oSearchField._bCreadedByFVH = true; // to only remove own SearchFields
				} else {
					this._oSearchField.setConditions([]); // initialize
				}

				oFilterBar.setBasicSearchField(this._oSearchField);
			}
		}

		if (this._oSearchField && !this._oSearchField.getParent()) {
			// not longer needed -> destroy
			this._oSearchField.destroy();
			delete this._oSearchField;
		}

	}
/* if search is supported a SearchField is needed on the Dialog. (not on the suggest-popover)
	 * If there is a FilterBar given, add the SearchField to it.
	 * If there is no FilterBar given, create a new one and add the SearchField.
	 */
if search is supported a SearchField is needed on the Dialog. (not on the suggest-popover)
If there is a FilterBar given, add the SearchField to it.
If there is no FilterBar given, create a new one and add the SearchField.
if search is supported a SearchField is needed on the Dialog . ( not on the suggest - popover ) If there is a FilterBar given add the SearchField to it . If there is no FilterBar given create a new one and add the SearchField .
function _initializeSearchField(bAsync) {
		if (bAsync) {
			if (!this._iSearchFieldTimer) {
				this._iSearchFieldTimer = setTimeout(function() {
					this._iSearchFieldTimer = undefined;
					_initializeSearchField.call(this, false);
				}.bind(this), 0);
			}
			return;
		} else if (this._iSearchFieldTimer) { 
			clearTimeout(this._iSearchFieldTimer);
			this._iSearchFieldTimer = null;
		}
		var sFilterFields = this.getFilterFields();
		var oWrapper = _getWrapper.call(this, false); 
		if (sFilterFields && oWrapper) {
			var oFilterBar = this._getFilterBar();
			if (!oFilterBar) {
				oFilterBar = new FilterBar(this.getId() + "-FB", {
					liveMode: !oWrapper.isSuspended(), 
					showGoButton: false
				});
				oFilterBar.setInternalConditions(this._oConditions); 
				this._oConditions = {};
				this.setAggregation("_filterBar", oFilterBar, true);
			}
			if (!oFilterBar.getBasicSearchField()) {
				if (!this._oSearchField) { 
					this._oSearchField = new FilterField(this.getId() + "-search", {
						conditions: "{$filters>/conditions/" + sFilterFields + "}",
						placeholder:"{$i18n>filterbar.SEARCH}",
						label:"{$i18n>filterbar.SEARCH}", 
						maxConditions: 1,
						width: "50%"
					});
					this._oSearchField._bCreadedByFVH = true; 
				} else {
					this._oSearchField.setConditions([]); 
				}
				oFilterBar.setBasicSearchField(this._oSearchField);
			}
		}
		if (this._oSearchField && !this._oSearchField.getParent()) {
			this._oSearchField.destroy();
			delete this._oSearchField;
		}
	}
function _initializeSearchField ( bAsync ) { if ( bAsync ) { if ( ! this . _iSearchFieldTimer ) { this . _iSearchFieldTimer = setTimeout ( function ( ) { this . _iSearchFieldTimer = undefined ; _initializeSearchField . call ( this , false ) ; } . bind ( this ) , 0 ) ; } return ; } else if ( this . _iSearchFieldTimer ) { clearTimeout ( this . _iSearchFieldTimer ) ; this . _iSearchFieldTimer = null ; } var sFilterFields = this . getFilterFields ( ) ; var oWrapper = _getWrapper . call ( this , false ) ; if ( sFilterFields && oWrapper ) { var oFilterBar = this . _getFilterBar ( ) ; if ( ! oFilterBar ) { oFilterBar = new FilterBar ( this . getId ( ) + "-FB" , { liveMode : ! oWrapper . isSuspended ( ) , showGoButton : false } ) ; oFilterBar . setInternalConditions ( this . _oConditions ) ; this . _oConditions = { } ; this . setAggregation ( "_filterBar" , oFilterBar , true ) ; } if ( ! oFilterBar . getBasicSearchField ( ) ) { if ( ! this . _oSearchField ) { this . _oSearchField = new FilterField ( this . getId ( ) + "-search" , { conditions : "{$filters>/conditions/" + sFilterFields + "}" , placeholder : "{$i18n>filterbar.SEARCH}" , label : "{$i18n>filterbar.SEARCH}" , maxConditions : 1 , width : "50%" } ) ; this . _oSearchField . _bCreadedByFVH = true ; } else { this . _oSearchField . setConditions ( [ ] ) ; } oFilterBar . setBasicSearchField ( this . _oSearchField ) ; } } if ( this . _oSearchField && ! this . _oSearchField . getParent ( ) ) { this . _oSearchField . destroy ( ) ; delete this . _oSearchField ; } }
if search is supported a SearchField is needed on the Dialog.
if search is supported a SearchField is needed on the Dialog .
// in case of a pending timeOut but sync calling, skip pending timeout // without content it makes no sense to have a SearchField // if suspended, no live search // if already InParameter or SearchValue set, move it to FilterBar // reuse SearchField if just FilterBar switched (CollectiveSearch case) // TODO: do we want a label? // to only remove own SearchFields // initialize // not longer needed -> destroy