on 02-02-2016 3:09 PM
Experts,
I have employee data in JSON format(text file attached). I am using sap.ui.layout.form.Form to display the employee’s First Name. Currently I have 3 employees in the file. My question is how can dynamically show the employee's First Name in the form fields. By dynamically I mean, I don’t want to use the code that I am currently using below to display data against the “value” in the text field? Can I substitute the path that is used against the “value” say, by a variable such as employee id , and can display first name?
new sap.ui.layout.form.FormContainer({
formElements: [
new sap.ui.layout.form.FormElement({
fields: [new sap.ui.commons.TextField({
value: "{/employees/employee/0/firstName}",
width: "50px"
})
So you want to show form for each employee?
You can use row repeater (sap.ui.commons.RowRepeater) and bind the rows aggregation to "{ path: '/employees/employee' }"
the rows content will be your form with Fisrtname set to "{firstName}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vaibhav,
Thanks for your reply. I am trying to display employee details in the form. So dont want to display all the employees, just the selected employee in the form. As of now I haven't written the code for selection/filter criteria. Thats why is I want pass variable such as employee number and show employee first name in the textField.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.