08-18-2017 5:41 AM - edited 02-04-2024 12:25 AM
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
The explanation of columnKey in the blog post How to add a new column to a responsive table under ListReport and ObjectPage of a Smart template ap... helped me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'}" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.