Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

setModel which has arrays in it and access properties when mapping

Hi, I have a Form with FormContainer. I am setting a json model to the form.

A sample is goes like this:

     contract: {

       visible: {

         contractType: true,

         validUntil: true,

         contractInfo: true

       },

       enabled: {

         contractType: false,

         validUntil: false,

         contractInfo: false

       },

       required: {

         contractType: false,

         validUntil: false,

         contractInfo: false

       }

     },

     salary: [{

       visible: {

         validFrom: true,

         validUntil: true,

         payType: true,

         salarySum: true,

         addSalaryBtn: false

       }

     }],

...

I am having no problem setting contract model part to formelements like (oUIProperties is the model name i have when setting the json model to the form):

visible: "{oUIProperties>/contract/visible/contractType}"

Question 1: Can I set a model for FormContainer? (If i try setting a model it says that mBindProperty is unknown or smth).

Question 2: How can I set properties which are in an array? The salary part of the model can have more than 1 element, since I can create more than 1 salary FormContainer and I want to bind the properties by accessing the salary array-s object properties.

Tags:
Former Member
Former Member replied

heh, turned out to be quite simple:

visible: "{oUIProperties>/salary/0/visible/validFrom}"



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question