0
votes

I"m binding my tile container in xml view as

    <TileContainer id="idsolutionContainer"     tiles="{ path: 'dlCourses>/DLES_COURSE_CONTENT' }">
       <tiles>
            <dles:DLESScoreTile name="{dlCourses>LJ_TITLE}" topicId="{dlesScore>ID}" topic="{dlCourses>LJ_SOLUTION}" dles="{dlCourses>DLES}" id="tileDLESCourse" press=".handleCourseClick"></dles:DLESScoreTile>
        </tiles>
    </TileContainer>`

and on the backend on inint fucntion I'm trying to filter by LJ_SOLUTION but it doesn't work. it gives me all the courses. I'm getting LJ_SOLUTION from query string that's why i'm not filtring on front end. the code is as

        var coursePath = "/DLES_COURSE_CONTENT";
        var filterByName = new sap.ui.model.Filter('LJ_SOLUTION', 'EQ', 'Analytics')
        //sPath = "/DLES_SOLUTION_CONTENT?$filter=LJ_SOLUTION eq  '" + sId + "')";
        var courses = oView.getModel("dlCourses");
        var courseData = oModel.getData(coursePath);
        oView.bindElement({
            path: coursePath,
            filters: [ new sap.ui.model.Filter("LJ_SOLUTION",sap.ui.model.FilterOperator.EQ, "Analytics") ],
            model: "dlCourses",
            events: {
                dataRequested: function() {

                    oView.setBusy(true);
                },
                dataReceived: function() {
                    oView.setBusy(false);
                }
            }
        });

The network tab... DLES_COURSE_CONTENT REQUEST there is another request batch I don't understand completely but the request query is as batch Request Query

2

2 Answers

1
votes
            var oView = this.getView();
var oSolutionJourneyList = oView.byId("idsolutionContainer");
            var oBinding = oSolutionJourneyList.getBinding("tiles");
            if (oBinding) {
                var oFilter = new sap.ui.model.Filter("LJ_SOLUTION", 'EQ', 'Analytics');
                oBinding.filter([oFilter]);
            }
0
votes

Please remove the code “var courseData = oModel.getData(coursePath);”

because this loads the entire model. The bindElement will also create a request to load the required data only. Then, check the request which is created by bindElement to see if the path for “LJ_Solution” is correct.