Skip to Content
avatar image
Former Member

Refresh/update custom control in sapui5 when model change

I've a custom control which have multiple properties inserted in Detail View page. I've binded data with these properties. Scenario is I've two pages one is list view and then detail view. I've to navBack from detail page and select diff product from main page.Detail view page show diff products detail according to selected product. everything works fine. but problem is that my custom control doesn't update values and other page have updated values.

<custom:product topic="" subTopic="{product>name}" id="productDetial"></custom:product>
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2017 at 04:11 PM
    setSubTopic: function(sText){
            this.setProperty("subTopic", sText, true);
            $("#"+this.sId+" .leftTileYourScore").html(sText);
        }

    I found the solution of above problem. Just I've to call the setProperty Method in my control.js file. and change inside Html after each time rendering

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2017 at 10:02 AM

    Hi Nafees,

    Check if the model associated with the custom control is available and also getting updated,

    Like, "oEvent.getSource().getModel('Model_Name')".

    Regards,

    Ravikiran

    Add comment
    10|10000 characters needed characters exceeded