function _setLayoutDataForLinebreak( oControl, oContainer, iVisibleContainer, oContainerNext, iVisibleContainers ) {

		var oLayout;
		if (oControl instanceof Panel) {
			oLayout = sap.ui.getCore().byId(oControl.getLayout());
		} else {
			oLayout = oControl.__myParentLayout;
		}

		var oLD = oLayout.getLayoutDataForElement(oContainer, "sap.ui.layout.GridData");
		if (!oLD) {
			// only needed if container has no own LayoutData
			var iColumnsM = oLayout.getColumnsM();
			var iColumnsL = oLayout.getColumnsL();
			// If the columsnXL is not set the value of columnsL is used
			var iColumnsXL = oLayout.getColumnsXL();

			var bLinebreakL = (iVisibleContainer % iColumnsL) == 1;
			var bLastL = (iVisibleContainer % iColumnsL) == 0;
			var bLastRowL = iVisibleContainer > (iColumnsL * (Math.ceil(iVisibleContainers / iColumnsL) - 1));
			var bFirstRowL = iVisibleContainer <= iColumnsL;
			var bLinebreakM = (iVisibleContainer % iColumnsM) == 1;
			var bLastM = (iVisibleContainer % iColumnsM) == 0;
			var bLastRowM = iVisibleContainer > (iColumnsM * (Math.ceil(iVisibleContainers / iColumnsM) - 1));
			var bFirstRowM = iVisibleContainer <= iColumnsM;

			var bLinebreakXL = false;
			var bLastXL = bLastL;
			var bLastRowXL = bLastRowL;
			var bFirstRowXL = bFirstRowL;
			if (iColumnsXL > 0) {
				bLinebreakXL = (iVisibleContainer % iColumnsXL) == 1;
				bLastXL = (iVisibleContainer % iColumnsXL) == 0;
				bLastRowXL = iVisibleContainer > (iColumnsXL * (Math.ceil(iVisibleContainers / iColumnsXL) - 1));
				bFirstRowXL = iVisibleContainer <= iColumnsXL;
			}

			if (oContainerNext) {
				var oLDNext = oLayout.getLayoutDataForElement(oContainerNext, "sap.ui.layout.GridData");
				if (oLDNext && ( oLDNext.getLinebreak() || oLDNext.getLinebreakXL() )) {
					bLastXL = true;
					bLastRowXL = false;
				}
				if (oLDNext && ( oLDNext.getLinebreak() || oLDNext.getLinebreakL() )) {
					bLastL = true;
					bLastRowL = false;
				}
				if (oLDNext && ( oLDNext.getLinebreak() || oLDNext.getLinebreakM() )) {
					bLastM = true;
					bLastRowM = false;
				}
			}

			var sStyle = "";

			if (bLastXL) {
				sStyle = "sapUiFormResGridLastContXL";
			}
			if (bLastL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastContL";
			}
			if (bLastM) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastContM";
			}

			if (bLastRowXL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastRowXL";
			}
			if (bLastRowL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastRowL";
			}
			if (bLastRowM) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastRowM";
			}

			if (bFirstRowXL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridFirstRowXL";
			}
			if (bFirstRowL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridFirstRowL";
			}
			if (bFirstRowM) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridFirstRowM";
			}

			oLD = oControl.getLayoutData();
			if (!oLD) {
				oLD = new GridData(oControl.getId() + "--LD", { linebreakL: bLinebreakL, linebreakM: bLinebreakM });
				oControl.setLayoutData( oLD );
			} else {
				oLD.setLinebreakL(bLinebreakL);
				oLD.setLinebreakM(bLinebreakM);
			}
			if (iColumnsXL > 0) {
				oLD.setLinebreakXL(bLinebreakXL);
			}
			oLD._setStylesInternal(sStyle);
		}

	}
// oControl could be a Panel or a Grid( if no panel used)
oControl could be a Panel or a Grid( if no panel used)
oControl could be a Panel or a Grid ( if no panel used )
function _setLayoutDataForLinebreak( oControl, oContainer, iVisibleContainer, oContainerNext, iVisibleContainers ) {
		var oLayout;
		if (oControl instanceof Panel) {
			oLayout = sap.ui.getCore().byId(oControl.getLayout());
		} else {
			oLayout = oControl.__myParentLayout;
		}
		var oLD = oLayout.getLayoutDataForElement(oContainer, "sap.ui.layout.GridData");
		if (!oLD) {
			var iColumnsM = oLayout.getColumnsM();
			var iColumnsL = oLayout.getColumnsL();
			var iColumnsXL = oLayout.getColumnsXL();
			var bLinebreakL = (iVisibleContainer % iColumnsL) == 1;
			var bLastL = (iVisibleContainer % iColumnsL) == 0;
			var bLastRowL = iVisibleContainer > (iColumnsL * (Math.ceil(iVisibleContainers / iColumnsL) - 1));
			var bFirstRowL = iVisibleContainer <= iColumnsL;
			var bLinebreakM = (iVisibleContainer % iColumnsM) == 1;
			var bLastM = (iVisibleContainer % iColumnsM) == 0;
			var bLastRowM = iVisibleContainer > (iColumnsM * (Math.ceil(iVisibleContainers / iColumnsM) - 1));
			var bFirstRowM = iVisibleContainer <= iColumnsM;
			var bLinebreakXL = false;
			var bLastXL = bLastL;
			var bLastRowXL = bLastRowL;
			var bFirstRowXL = bFirstRowL;
			if (iColumnsXL > 0) {
				bLinebreakXL = (iVisibleContainer % iColumnsXL) == 1;
				bLastXL = (iVisibleContainer % iColumnsXL) == 0;
				bLastRowXL = iVisibleContainer > (iColumnsXL * (Math.ceil(iVisibleContainers / iColumnsXL) - 1));
				bFirstRowXL = iVisibleContainer <= iColumnsXL;
			}
			if (oContainerNext) {
				var oLDNext = oLayout.getLayoutDataForElement(oContainerNext, "sap.ui.layout.GridData");
				if (oLDNext && ( oLDNext.getLinebreak() || oLDNext.getLinebreakXL() )) {
					bLastXL = true;
					bLastRowXL = false;
				}
				if (oLDNext && ( oLDNext.getLinebreak() || oLDNext.getLinebreakL() )) {
					bLastL = true;
					bLastRowL = false;
				}
				if (oLDNext && ( oLDNext.getLinebreak() || oLDNext.getLinebreakM() )) {
					bLastM = true;
					bLastRowM = false;
				}
			}
			var sStyle = "";
			if (bLastXL) {
				sStyle = "sapUiFormResGridLastContXL";
			}
			if (bLastL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastContL";
			}
			if (bLastM) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastContM";
			}
			if (bLastRowXL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastRowXL";
			}
			if (bLastRowL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastRowL";
			}
			if (bLastRowM) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridLastRowM";
			}
			if (bFirstRowXL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridFirstRowXL";
			}
			if (bFirstRowL) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridFirstRowL";
			}
			if (bFirstRowM) {
				if (sStyle) {
					sStyle = sStyle + " ";
				}
				sStyle = sStyle + "sapUiFormResGridFirstRowM";
			}
			oLD = oControl.getLayoutData();
			if (!oLD) {
				oLD = new GridData(oControl.getId() + "--LD", { linebreakL: bLinebreakL, linebreakM: bLinebreakM });
				oControl.setLayoutData( oLD );
			} else {
				oLD.setLinebreakL(bLinebreakL);
				oLD.setLinebreakM(bLinebreakM);
			}
			if (iColumnsXL > 0) {
				oLD.setLinebreakXL(bLinebreakXL);
			}
			oLD._setStylesInternal(sStyle);
		}
	}
function _setLayoutDataForLinebreak ( oControl , oContainer , iVisibleContainer , oContainerNext , iVisibleContainers ) { var oLayout ; if ( oControl instanceof Panel ) { oLayout = sap . ui . getCore ( ) . byId ( oControl . getLayout ( ) ) ; } else { oLayout = oControl . __myParentLayout ; } var oLD = oLayout . getLayoutDataForElement ( oContainer , "sap.ui.layout.GridData" ) ; if ( ! oLD ) { var iColumnsM = oLayout . getColumnsM ( ) ; var iColumnsL = oLayout . getColumnsL ( ) ; var iColumnsXL = oLayout . getColumnsXL ( ) ; var bLinebreakL = ( iVisibleContainer % iColumnsL ) == 1 ; var bLastL = ( iVisibleContainer % iColumnsL ) == 0 ; var bLastRowL = iVisibleContainer > ( iColumnsL * ( Math . ceil ( iVisibleContainers / iColumnsL ) - 1 ) ) ; var bFirstRowL = iVisibleContainer <= iColumnsL ; var bLinebreakM = ( iVisibleContainer % iColumnsM ) == 1 ; var bLastM = ( iVisibleContainer % iColumnsM ) == 0 ; var bLastRowM = iVisibleContainer > ( iColumnsM * ( Math . ceil ( iVisibleContainers / iColumnsM ) - 1 ) ) ; var bFirstRowM = iVisibleContainer <= iColumnsM ; var bLinebreakXL = false ; var bLastXL = bLastL ; var bLastRowXL = bLastRowL ; var bFirstRowXL = bFirstRowL ; if ( iColumnsXL > 0 ) { bLinebreakXL = ( iVisibleContainer % iColumnsXL ) == 1 ; bLastXL = ( iVisibleContainer % iColumnsXL ) == 0 ; bLastRowXL = iVisibleContainer > ( iColumnsXL * ( Math . ceil ( iVisibleContainers / iColumnsXL ) - 1 ) ) ; bFirstRowXL = iVisibleContainer <= iColumnsXL ; } if ( oContainerNext ) { var oLDNext = oLayout . getLayoutDataForElement ( oContainerNext , "sap.ui.layout.GridData" ) ; if ( oLDNext && ( oLDNext . getLinebreak ( ) || oLDNext . getLinebreakXL ( ) ) ) { bLastXL = true ; bLastRowXL = false ; } if ( oLDNext && ( oLDNext . getLinebreak ( ) || oLDNext . getLinebreakL ( ) ) ) { bLastL = true ; bLastRowL = false ; } if ( oLDNext && ( oLDNext . getLinebreak ( ) || oLDNext . getLinebreakM ( ) ) ) { bLastM = true ; bLastRowM = false ; } } var sStyle = "" ; if ( bLastXL ) { sStyle = "sapUiFormResGridLastContXL" ; } if ( bLastL ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridLastContL" ; } if ( bLastM ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridLastContM" ; } if ( bLastRowXL ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridLastRowXL" ; } if ( bLastRowL ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridLastRowL" ; } if ( bLastRowM ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridLastRowM" ; } if ( bFirstRowXL ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridFirstRowXL" ; } if ( bFirstRowL ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridFirstRowL" ; } if ( bFirstRowM ) { if ( sStyle ) { sStyle = sStyle + " " ; } sStyle = sStyle + "sapUiFormResGridFirstRowM" ; } oLD = oControl . getLayoutData ( ) ; if ( ! oLD ) { oLD = new GridData ( oControl . getId ( ) + "--LD" , { linebreakL : bLinebreakL , linebreakM : bLinebreakM } ) ; oControl . setLayoutData ( oLD ) ; } else { oLD . setLinebreakL ( bLinebreakL ) ; oLD . setLinebreakM ( bLinebreakM ) ; } if ( iColumnsXL > 0 ) { oLD . setLinebreakXL ( bLinebreakXL ) ; } oLD . _setStylesInternal ( sStyle ) ; } }
oControl could be a Panel or a Grid( if no panel used)
oControl could be a Panel or a Grid ( if no panel used )
// only needed if container has no own LayoutData // If the columsnXL is not set the value of columnsL is used