Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 27, 2015 at 10:08 AM

    heh, turned out to be quite simple:

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



    Add comment
    10|10000 characters needed characters exceeded