cancel
Showing results for 
Search instead for 
Did you mean: 

Binding Expand entity into table - UI5

Mahmoud-Farag
Participant
0 Kudos
1,887

Dears,
I have a Task that I need some help with,
I have create Search help for Employees my Task after select one of this I need to display his Tasks,
I created Association between tasks table and employee and its works well,
My Issue how to bind the Expand tasks to Table ,

The header data display well but the Tasks Items doesn't Display , in the init function:
oTable.bindRows({path : "/ZEMP_INFOSet", parameters : { "expand":"EmpToTask"}} );
I have check the gateway and the code working find go through debugger, and select the data .

I think the Issue with the Binding of the Table, I have tried many format but does not work:
<Text id="_IDGenText2" text="{/EmpName}" wrapping="false" />

<Text id="_IDGenText2" text="{EmpToTask/TaskName}" wrapping="false" />
a

I need some help with display the tasks in the Table,

Regards,
Mahmoud Farag

Accepted Solutions (1)

Accepted Solutions (1)

junwu
SAP Champion
SAP Champion

assume you are binding to default model(no name model)

in the view, for table rows="{EmpToTask}", for cell <Text id="_IDGenText2" text="{TaskName}" wrapping="false" />

in your controller, once you selected the user you should have the path or bindingcontext

you can use either table.setBindingContext

or table.bindElement(path)

Mahmoud-Farag
Participant
0 Kudos

Dear jun.wu5 , first thaks for your answer but,
I have use:
oTable.bindElement({path : "/ZEMP_INFOSet", parameters : { "expand":"EmpToTask"}});

and change : rows="{EmpToTask}", for cell <Text id="_IDGenText2" text="{TaskName}" wrapping="false" />
Without any difference:

this is the body of the request I need to display the EmpToTask [ ] in The Table, How can I bind it to the Table

-------------
"EmpId" : "1",

"EmpName" : "************",
"EmpEmail" : "************",
"EmpHireDate" : "\/Date(1640995200000)\/",
"EmpSalary" : "1885.000",
"Note" : "11111111111",
"EmpToTask" : {
"results" : [
{

"EmpId" : "1",
"TaskId" : "1",
"TaskName" : "TEST",
"TaskDesc" : "TEST",
"TaskStatus" : "TEST",
"TaskStartDate" : "\/Date(1672185600000)\/",
"Duration" : "000006",
"TaskEndDate" : "\/Date(1672012800000)\/"
},]
junwu
SAP Champion
SAP Champion

just follow what I said, forget what you have. if you don't know how to follow, then ask detail question.

junwu
SAP Champion
SAP Champion

oTable.bindElement("/ZEMP_INFOSet(yourdetailid)");

Answers (0)