cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Smartchart sorting or filtering isn't triggering correct get request

tarrandurham
Explorer
0 Kudos

I am trying to get the smartchart filtering to work. I have tried this on several different charts, data-sources, applications and odata services.

  1. Create an app
  2. Create a smart table
  3. Create a smart smart
  4. Use same data-source for both (odata entityset)

-> Apply sorting on anything

On the table this work just fine, if you check the GET request in chrome developer view:

GET Z_I_OTHEREVENTS_Z1?$skip=0&$top=58&$orderby=event_code%20asc&$select=event_code%2cext_loc_id%2ctor_id%2cyear_%2cmonth_ HTTP/1.1

On the smartchart however nothing is sorted or filtered, because the GET request isn't correct:

GET Z_I_OTHEREVENTS_Z1?$skip=0&$top=58 HTTP/1.1

What am I doing wrong? Why is the GET request not being properly built?

Here my XML:

<mvc:View xmlns:core="sap.ui.core" xmlns="sap.m" controllerName="test1.test1.controller.View1" xmlns:smartchart="sap.ui.comp.smartchart"
    xmlns:sl="sap.ui.comp.navpopover" xmlns:mvc="sap.ui.core.mvc" xmlns:data="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
    xmlns:smartTable="sap.ui.comp.smarttable" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar">
    <VBox>
        <smartTable:SmartTable id="LineItemsSmartTable" entitySet="Z_I_OTHEREVENTS_Z1"  tableType="Table"
            useExportToExcel="true" beforeExport="onBeforeExport" useTablePersonalisation="true" header="Line Items"
            showRowCount="true" initiallyVisibleFields="event_code" enableAutoBinding="true">
            <!-- layout data used to make the table growing but the filter bar fixed -->
            <smartTable:layoutData>
                <FlexItemData growFactor="1" baseSize="0%"/>
            </smartTable:layoutData>
        </smartTable:SmartTable>
            <smartchart:SmartChart enableAutoBinding="true" entitySet="Z_I_OTHEREVENTS_Z1" chartType="bar"></smartchart:SmartChart>
    </VBox>
</mvc:View>
Joseph_BERTHE
Active Contributor
0 Kudos

Hi, can you give us your annotations please?

Regards,

Joseph

tarrandurham
Explorer
0 Kudos

Here my Annotations. Thank you so much for helping me.

<Annotations Target="Z_I_OTHEREVENTS_Z1_CDS.Z_I_OTHEREVENTS_Z1Type">
				<Annotation Term="UI.Chart">
					<Record Type="UI.ChartDefinitionType">
						<PropertyValue Property="Title" String="Gross Amount by Customer"/>
						<PropertyValue Property="Description" String="Line-chart displaying the gross amount by customer"/>
						<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Column"/>
						<PropertyValue Property="Dimensions">
							<Collection>
								<PropertyPath>event_code</PropertyPath>
							</Collection>
						</PropertyValue>
						<PropertyValue Property="Measures">
							<Collection>
								<PropertyPath>tor_id</PropertyPath>
							</Collection>
						</PropertyValue>
					</Record>
				</Annotation>
				<Annotation Term="UI.LineItem">
					<Collection>
						<Record Type="UI.DataField">
							<PropertyValue Property="Value" Path="event_code"/>
						</Record>
						<Record Type="UI.DataField">
							<PropertyValue Property="Value" Path="ext_loc_id"/>
						</Record>
						<Record Type="UI.DataField">
							<PropertyValue Property="Value" Path="tor_id"/>
						</Record>
						<Record Type="UI.DataField">
							<PropertyValue Property="Value" Path="year_"/>
						</Record>
						<Record Type="UI.DataField">
							<PropertyValue Property="Value" Path="month_"/>
						</Record>
					</Collection>
				</Annotation>
			</Annotations>


Accepted Solutions (1)

Accepted Solutions (1)

tarrandurham
Explorer
0 Kudos

I found the issue. Setting the Opertation Mode to "Auto" in the Manifest results in the Smartchart not binding the correct GET request.

Setting the Operation Mode to Server solves this issue.

Can someone explain?

Answers (0)