Skip to Content
0

Filtering with Selection from Multicombo-Box and Date-Picker

Jun 30, 2017 at 07:22 AM

56

avatar image
Former Member

Hi everybody :)

I just want to ask a little question:

I have 2 Date-Picker (1 for the beginning and 1 for the end) and 2 Multicombo-Boxes in my View. I want to filter a table in my SAP System with the selected values from the Date-Picker and the Boxes. I know i must use the sap.ui.model.Filter but i dont know how to develope in my controller. So can u help me with this ?

I thought i should do it as follow :

onInit : function(evt) {

			new sap.ui.model.Filter({
				path : "{//i'll add this later}",
			operator : "sap.ui.model.FilterOperator.GE,",
				value1 : "{/DateBegin}",
			});


			new sap.ui.model.Filter({
				path : "{//i'll add this later}",
			operator : "sap.ui.model.FilterOperator.LE,",
				value1 : "{/DateEnd}"
			});


			new sap.ui.model.Filter({
				path : "{//i'll add this later}",
			operator : "sap.ui.model.FilterOperator.EQ,",
				value1 : "{/Work1}",
				value2 : "{/Work2}"
			});
...
...

View :

<HBox class='settingsHBox'>
<VBox class='widerSettingsBox'>
<Label text='{/DateBegin/name}' design="Bold" class='settingsLabel' />
<DatePicker id="Date1" value="2015-01-16"
valueFormat="yyyy-MM-dd" displayFormat="long" change="handleChange"
class="sapUiSmallMarginBottom" />
</VBox>
<VBox class='widerSettingsBox'>
<Label text='{/DateEnd/name}' design="Bold" class='settingsLabel' />
<DatePicker id="Date2" placeholder="T.MMMM J"
displayFormat="long" change="handleChange" />
</VBox>
<VBox class='widerSettingsBox'>
<Label text='{/Work1/name}' design="Bold" class='settingsLabel' />
<MultiComboBox selectionChange="handleSelectionChange"
placeholder="choose work1 ..." selectionFinish="handleSelectionFinish"width="250px" items="{path: '/Work1/values'}">
<core:Item text="{name}" key="{key}" />
</MultiComboBox>
</VBox>
<VBox class='widerSettingsBox'>
<Label text='{/Work2/name}' design="Bold" class='settingsLabel' />
<MultiComboBox selectionChange="handleSelectionChange"
placeholder="choose work2..." selectionFinish="handleSelectionFinish"
width="250px" items="{path: '/Work2/values'}">
<core:Item text="{name}" key="{key}" />
</MultiComboBox>
</VBox>
</HBox>
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Jun 30, 2017 at 12:42 PM
1

hi

try this for your Multicombo in model ;

oModel.read("/testModelSet", {

async : false,

filters : aFilters, // your filter object

success : ...

error : ...

});

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Did this hand over my selected values from the Multicombo to my Filter in my ABAP programm on the SAP system ?

Sorry for asking but i want understand it not only copy paste a code :)

0