Skip to Content
avatar image
Former Member

How to do element binding in xml fragment in UI5 application

Hi guys,

I've raised a question which is bothering me so much on stackoverflow:

http://stackoverflow.com/questions/31624500/how-to-do-element-binding-in-xml-fragment-in-ui5-application

I don't want to copy paste again and reformat again because it's very long, sorry for that.

Any help will be very much appreciated.

thanks.

Regards,

Aaron

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 27, 2015 at 11:44 AM

    try

    <core:Fragment binding="{path:'Creator'}" fragmentName="xxx.fragment.User" type="XML"/>


    or


    move a contanier one level up and do a binding for controller in the view where you use it

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      <core:Fragment> itself (or sap.ui.core.Fragment) is not a control and has no representation at all in the runtime UI structure. I guess this is why settings on such an element in an XML View are not handled.

      I'll check whether this can be documented explicitly.

      Regarding the "binding" attribute: yeah, this was added two years ago in the XMLView parser, but not documented so far AFAIK. But documentation on how data binding is used in XMLViews has been generally missing and this gap is about to be filled - the documentation is currently in review and I saw that the "Element Binding" section in it will explain this attribute...

      Regards

      Andreas

  • avatar image
    Former Member
    Jul 25, 2015 at 11:14 AM

    sap.ui.getCore().byId("idInFragment").setModel(oModel);

    This will work. Cheers:-)

    Add comment
    10|10000 characters needed characters exceeded