You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will also need to add an ID field to the `<List>` element, directly below. Add this to the `<List>` element:
35
-
36
-
37
-
```
38
-
id="List"
39
-
```
40
-
41
-

34
+
You will also need to add an ID field to the `<List>` element, directly below. Add this to the `<List>` element:
35
+
36
+
37
+
```
38
+
id="List"
39
+
```
40
+
41
+

42
42
43
43
2. Open the `webapp/view/View1.controller.js` file, and update the Controller with the following new functionality:
44
44
45
45
>**Note** Be careful with the exact placement of this code. The code should go after a single closed braces `}`, on line 14.
46
46
47
47
48
-
```javascript
48
+
```javascript
49
49
, handleSearch : function (evt) { // create model filter var filters = []; var query = evt.getParameter("query"); if (query && query.length > 0) { var filter = new sap.ui.model.Filter("ProductName", sap.ui.model.FilterOperator.Contains, query); filters.push(filter); }
50
50
// update list binding var list = this.getView().byId("List"); var binding = list.getBinding("items"); binding.filter(filters); }
51
-
```
51
+
```
52
52
53
-

53
+

54
54
55
55
3. Run your application. You should see the search box at the top of the list, right below the words `Product Overview`.
56
56
57
-
> **NOTE**: If the search does not work, check the `View1.view.xml` file, and make sure the `<List>` element has an *id* parameter.
57
+
> **NOTE**: If the search does not work, check the `View1.view.xml` file, and make sure the `<List>` element has an *id* parameter.
58
58
59
-

59
+

60
60
61
61
62
62
## Next Steps
63
-
- The next tutorial in the series is Part 10: [Add an Order Activity to the form](https://go.sap.com/developer/tutorials/sapui5-webide-add-order-activity.html)
63
+
- The next tutorial in the series is Part 10: [Add an Order Activity to the form](https://go.sap.com/developer/tutorials/sapui5-webide-add-order-activity.html)
0 commit comments