Skip to Content
avatar image
Former Member

Access item of an aggregation binding

Hi experts,

In my XML view I have Control that used aggregation binding from a JSON model. My question is what is the earliest event that I can use to access the items of that Control in Controller?

For example, with <items> aggregation binding of an IconTabBar, when will I be able to access the item IconTabFilter?

Thanks much for your help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 23, 2015 at 09:39 AM

    Hi Nguyen,

    onInit - If you are declaring the model in component

    onAfterRendering - If you are declaring the model in controller

    Regards,

    Sai Vellanki.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Nguyen,

      Somehow I missed your response, sorry.

      As Dennis already mentioned you have to listen to attachRequestCompleted event then only you can get the IconTabBar items list. Basically it works like this, on load of page you are loading the json file. Application will hit onInit first where you're JSON model file is not loaded with data yet. Then later it hits the attachRequestCompleted where you have the data available in your model. You can do the manipulations there.


      One more thing is your code works fine with out attachRequestedCompleted as well if you add this attribute in your UI5 bootstrap - data-sap-ui-xx-bindingSyntax="complex". But, you cannot fetch number of items as I explained the issue root cause already. I have done few changes to your code. All the changes are done in index.html - Plunker


      Regards,

      Sai Vellanki.

  • Oct 23, 2015 at 09:46 AM
    Add comment
    10|10000 characters needed characters exceeded