Skip to Content
avatar image
Former Member

Possible to have a binding (aggregation binding) on matrix layout?

I wanted to bind the

sap.ui.commons.layout.MatrixLayout

to my model such that it created the items inside it (each item being an HBOX that has its own content) that are bound to the model.

If the modle has 10 objects, I would like to create 10 hboxes.

The hbox has text fiels inside it and they will be bound to the properties that are there in the objects in the model.

Is this possible? or do I have to manually run a loop to create this?

Please help!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 21, 2015 at 12:04 PM

    var oRowTemplate = new sap.ui.commons.layout.MatrixLayoutRow({

      cells: [

      new sap.ui.commons.layout.MatrixLayoutCell({

      content: new sap.ui.commons.Label({text:"propertyName:"})

      }),

      new sap.ui.commons.layout.MatrixLayoutCell({

      content: new sap.ui.commons.TextView({text:"{propertyValue}"})

      })

      ]

      });

      oMatrixLayout.bindAggregation("rows", "/properties", oRowTemplate);

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 21, 2015 at 12:52 PM

    Any one?

    Add comment
    10|10000 characters needed characters exceeded

    • You have marked this thread with a Correct Answer, so you are unlikely to get additional responses.  If you did this by mistake, you should be able to unassign the Correct Answer.  If not, send me a DM and I will do it for you.

      If your original question was solved, then create a new Discussion for your next question.

      Regards, Mike (Moderator)

      SAP Technology RIG