cancel
Showing results for 
Search instead for 
Did you mean: 

Element binding

TimMuchena
Participant
0 Kudos

Hi people

I am trying to implement element binding for my simple test app following some example but i cant get it to work. What am I doing wrong

app view

Thank you

Accepted Solutions (0)

Answers (3)

Answers (3)

saxos
Explorer
0 Kudos

Hey Eli,

try {persons>/FirstName}  && {persons>/LastName}

SergioG_TX
Active Contributor
0 Kudos

Mr Eli,

remove persons> from the binding as you already set the end point (persons) to the model

it should work now

TimMuchena
Participant
0 Kudos

Hi Sergio

Tried it before posting this discussion and it didnt work

Regards

SergioG_TX
Active Contributor
0 Kudos

your model then is not accurate to your end point on the js side..

change your json file to

{

persons: [

     { "PersonID" : "123456", "SurName":"White", "FirstName":"Jack" }

  ]

}

TimMuchena
Participant
0 Kudos

hi

That didnt work.

Regards

saivellanki
Active Contributor
0 Kudos

Hi Eli,

Can you share the model structure as well?

Regards,

Sai Vellanki.

TimMuchena
Participant
0 Kudos
saivellanki
Active Contributor
0 Kudos

Eli,

Then it should be:


<Input value="{person>/0/FirstName}" />

Same for others as well.

Best Regards,

Sai Vellanki.

TimMuchena
Participant
0 Kudos

Hi

Thanks but it didnt work

regards

saxos
Explorer
0 Kudos

Do you get any Error?

Could you pls debug and post a img of the model?

TimMuchena
Participant
0 Kudos

Please excuse my ignorance. By "img of the model", what exactly are you referring to?

saxos
Explorer
0 Kudos

Screenshot from the debugged JSONModel, person in your case.

var self = this;

oPersonModel.attachRequestCompleted(function(){

     console.log(self.oPersonModel.getData());

});

Screenshot from the output for example