cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: A table in a popover (must have a title)

0 Kudos

I have a popover like this:

The corresponding code uses a table:

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout">
	<ResponsivePopover id="SankeyPopver" title="{i18n>Selection.Label.Title}" class="PopOver" placement="Bottom">
		<beginButton>
			<Button text="{i18n>Selection.Button.CreateGroup}" 
			type="Emphasized" 
			tooltip= "{i18n>Selection.Button.CreateGroup}" press="onCreateTG"/>
		</beginButton>
		<endButton>
			<Button id="ShowKpiBtn" text= "{i18n>Selection.Button.ShowKPI}"
			tooltip= "{i18n>Selection.Button.ShowKPI}"
			press="onKPICharts"/>
		</endButton>
		<content>
			<Table id="productsTable" width="25rem">
				<!--items="{/ProductCollection}">-->
				<columns>
					<Column hAlign="Begin" id="productCol" width=""><Text text="{i18n>Selection.Label.Source}"/></Column>
					<Column hAlign="End" id="supplierCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>Selection.Label.Journeys}"/></Column>
					<Column hAlign="End" id="dimensionsCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>Selection.Label.UniqueCustomers}"/></Column>
				</columns>
				<items>
					<ColumnListItem>
						<cells>
							<!--<ObjectIdentifier  text="Identifier" class="sapMTableContentMargin"/>-->
							<Text text="{i18n>Selection.Label.OneItem}"/>
							<Text text="{/pathItemCount}"/>
							<Text text="{/contactCount}"/>
						</cells>

The Web IDE has a warning: "A table must define a custom header with a title element within"

So I am wondering should we use a table in this case? If I change to other tag instead of table, do I need to change any other file beside the fragment.xml file?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

Hi Jerry Zhang,

This is expected if you have Fiori XML validations selected in the project settings. There are a list of validations that will trigger if you select the Fiori XML

https://help.sap.com/viewer/825270ffffe74d9f988a0f0066ad59f0/Cloud/en-US/cb7e44b5f70449328c5282280e8...

This will not come if you put a toolbar in the headerToolbar aggregation of the table and have a title inside the toolbar. But you will get two titles. Instead you can ignore that message as this will not cause any issue (It's just an information message).

For your use case, I believe the tableSelectDialog is the best choice. For this it will have a tile, search and stuff..

https://ui5.sap.com/#/sample/sap.m.sample.TableSelectDialog/preview

BR,

Mahesh

Thank you very much!

Answers (0)