Skip to Content

UI5 smart table editable column - Export to excel functionality

I am trying to export data of a smart table, the table has a editable column. When I change the data in the column and do export I am seeing the original value not the changed value.

My View Code is below(Note Input value="{Project}" editable="true" from beow)
Have not coded anything in the controller.

<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:c="sap.ui.core" xmlns:core="sap.ui.core"
xmlns:atable="sap.ui.table" controllerName="app.controller.StatusNew" displayBlock="true">
<Page enableScrolling="true" showHeader="false">
<content>
<!--<VBox>-->
<sap.ui.comp.smartfilterbar:SmartFilterBar hSpacing="0" filterBarExpanded="true" showGoOnFB="true" search="onSearch"
xmlns:sap.ui.comp.smartfilterbar="sap.ui.comp.smartfilterbar" id="filbar" entitySet="empStatusSet">
<sap.ui.comp.smartfilterbar:controlConfiguration>
<sap.ui.comp.smartfilterbar:ControlConfiguration id="Id1" key="ResourceId" visibleInAdvancedArea="true" index="0"/>
<sap.ui.comp.smartfilterbar:ControlConfiguration id="Id2" key="Project" visibleInAdvancedArea="true" index="1"/>
<sap.ui.comp.smartfilterbar:ControlConfiguration id="Id3" key="MyOwnFilterField1" index="2" visibleInAdvancedArea="true"
label="Named User">
<sap.ui.comp.smartfilterbar:customControl>
<MultiComboBox id="idcomboRole" selectionChange="onRoleSel" selectionFinish="onRoleSelFinish">
<c:Item key="idbmgr" text="{i18n>Billing Manager}"/>
<c:Item key="idbpart" text="{i18n>Billing Partner}"/>
<c:Item key="idengmtmgr" text="{i18n>Engagement Manager}"/>
<c:Item key="idengpart" text="{i18n>Engagement Partner}"/>
<c:Item key="idprojcont" text="{i18n>Engagement Controller}"/>
<c:Item key="idpartptnr" text="{i18n>Participating Partner}"/>
<c:Item key="idpartmgr" text="{i18n>Participating Manager}"/>
</MultiComboBox>
</sap.ui.comp.smartfilterbar:customControl>
</sap.ui.comp.smartfilterbar:ControlConfiguration>
</sap.ui.comp.smartfilterbar:controlConfiguration>
</sap.ui.comp.smartfilterbar:SmartFilterBar>

<sap.ui.comp.smarttable:SmartTable id="idTab" mode="SingleSelectLeft" xmlns:sap.ui.comp.smarttable="sap.ui.comp.smarttable" smartFilterId="smartFilterBar" tableType="TreeTable" editable="false"
entitySet="empStatusSet" useVariantManagement="true" useTablePersonalisation="true" header="Status" showRowCount="true"
useExportToExcel="true" enableAutoBinding="true" persistencyKey="SmartTablePKey" initiallyVisibleFields="WeekendDate,ResourceId,Project">
<sap.ui.comp.smarttable:customToolbar>
<OverflowToolbar width="auto" height="auto" design="Transparent" visible="true" enabled="true">
<content>
<Title id="idTitle" text="{worklistView>/worklistTableTitle}" titleStyle="Auto" width="auto" textAlign="Begin" visible="true" wrapping="false"/>
<ToolbarSpacer width=""/>
<Button text="" type="Default" icon="sap-icon://add" iconFirst="true" width="auto" enabled="true" visible="true" iconDensityAware="false" press="addStatus"/>
<Button text="Delete" type="Default" iconFirst="true" width="auto" enabled="true" visible="true" tooltip="Delete Status"
iconDensityAware="false" press="deleteStatus"/>
<!--<OverflowToolbarButton text="Action" type="Default" icon="sap-icon://action" iconFirst="true" width="auto" enabled="true" visible="true"-->
<!--iconDensityAware="false"/>-->
</content>
</OverflowToolbar>
</sap.ui.comp.smarttable:customToolbar>
<!--</headerToolbar>-->
<!--<ScrollContainer id="__scrollContainer0" horizontal="true" vertical="true">-->
<Table id="idTab1">
<columns>
<Column id="WeekendDate" width="100px" mergeDuplicates="false">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "WeekendDate", "maxLength": "5","columnIndex":"4", "leadingProperty": "WeekendDate"}'/>
</customData>
<Text text="WeekendDate"/>
</Column>
<Column id="ResourceId" width="100px" mergeDuplicates="false">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "ResourceId", "maxLength": "5","columnIndex":"4", "leadingProperty": "ResourceId"}'/>
</customData>
<Text text="ResourceId"/>
</Column>
<Column id="Project" width="100px" >
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "Project", "maxLength": "5","columnIndex":"4", "leadingProperty": "Project"}'/>
</customData>
<Text text="Project"/>
</Column>
<Column id="Description" width="100px">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "Description", "maxLength": "5","columnIndex":"4", "leadingProperty": "Description"}'/>
</customData>
<Text text="Description"/>
</Column>
</columns>
<items>
<ColumnListItem type="Navigation" press="onItemPress">
<cells>
<Text text="{WeekendDate}"/>
</cells>
<cells>
<Text text="{ResourceId}"/>
</cells>
<cells>
<Input value="{Project}" editable="true"/>
</cells>
<cells>
<Text text="{Description}"/>
</cells>
</ColumnListItem>
</items>
</Table>
<!--</ScrollContainer>-->
</sap.ui.comp.smarttable:SmartTable>
<!--</VBox>-->
</content>
</Page>
</mvc:View>
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Oct 27, 2018 at 01:42 AM

    Haven't gone through your code (not very well readable) but have you bound your input field to a model?

    Add comment
    10|10000 characters needed characters exceeded