cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using custom column in UI5 Smart Table

SaschaW
Participant
0 Kudos

Hi experts,

i have created a normal oData-service(standard-annotations not vocabulary-based-annotations) in the backend and wanted to use this with a smart table. It worked very good. Then i wanted to add a custom column to display an icon.

But then there comes an uncaught exception which says "The table instance provided contain some columns for which a columnKey is provided, some for which a columnKey is not provided. This is not allowed !"

My coding for the smarttable in the view:

<smartTable:SmartTable 
	id="smartTable_ResponsiveTable"
	tableType="ResponsiveTable" 
	editable="false"
	entitySet="PRESSet" 
	useVariantManagement="true"
	useTablePersonalisation="true" 
	showRowCount="true"
	showFullScreenButton="true"
	useExportToExcel="true" 
	initiallyVisibleFields="Pernr,Nachn,Vorna,StatusIcon,Status"
	demandPopin="true"
	enableAutoBinding="true">
				
	     <Table>
		<columns>
		<Column width="100px">
		<customData>
		<core:CustomData key="p13nData"
		value='\{"columnKey": "Icon", "maxLength": "5",
                "columnIndex":"4", "leadingProperty": "Icon"}' />
		</customData>
		<Text text="StatusIcon" />
		</Column>
		</columns>
		<items>
		<ColumnListItem>
			<cells>
			<Text text="{StatusIcon}" />
			</cells>
		</ColumnListItem>
		</items>
		</Table> 
								
</smartTable:SmartTable> 

Anyone has an idea what could be the problem?

Greets

Sascha

Accepted Solutions (0)

Answers (4)

Answers (4)

gregorw
Active Contributor
former_member221786
Active Participant

I got rid of this error message by removing the leading slash in CustomData (in SAPUI5 version 1.71.40)

Don't know if this a version issue or something else but worth a try:

<core:CustomData key="p13nData"
		value="{'columnKey': 'Icon', 'maxLength': '5',
                'columnIndex':'4', 'leadingProperty': 'Icon'}" />
AlexNecula
Active Contributor
0 Kudos

Thanks! This fixed it for me.

vinaysbisen
Explorer
0 Kudos

A unique key used to save, retrieve, or apply personalization for a column.

just change the Leading Property and Column key to " StatusIcon" and it will work.

iftah_peretz
Active Contributor
0 Kudos

Hi,

It is unclear from what you give here to spot the exact problem.

However, based on what you say, you manage to pass the OData and bind it. If so,then simply pass the icons on the backend odata and present them in the smart-table. You can map the icons column in the controller or onInit phase based on your business need.