cancel
Showing results for 
Search instead for 
Did you mean: 

Worklist application using Template and adding create option in SAP UI5

0 Kudos

Experts,

Please help me with this. I am not getting any direction.

I have created a Worklist UI5 application using the template option in WebIDE.

Ideally a worklist has 2 views one for the Header and the second for the item.

In my case, I would need to have an additional button on Header view page with a Create option. And I need to use the same EntitySet which I used for Header->Item navigation too.

When an item is clicked, the respective item would be showed as per Binding. However when Create is clicked, the same EntitySet needs to be used with blank edit screen in the second view. If I try to use a dummy primary key, it errors out. I am using Odata and adding a dummy record into the oData Model generated a random object key and using that option looks difficult.

If you are able to relate to this, please suggest me what to do.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

it is all standard for a list app,

just make sure your entity is creatable and the attributes you are trying to fill are creatable.

0 Kudos

Thank you Jun Wu. Lets say I want to navigate in the following manner,

EntitySet/{Primary Key}, how would I do it in this case. If i pass a blank value to primary key, it is not accepting.

junwu
Active Contributor
0 Kudos

are you using fiori list report template?

0 Kudos

Yes. I am using a Worklist application template.

junwu
Active Contributor
0 Kudos

using list report please

Answers (1)

Answers (1)

CristianBabei
Contributor
0 Kudos

Not very clear what you want to do, anyway.

You can open an Xml fragment, to create. and bit it with a createEntry("/EntiySet") and bind the context, and to have it as twoway, this way when you submit the changes it will recognize it.

Another way would be, don't bind the fields, until they press create.And after that create the request.

For createEntry, and bind, you can use this:

var oBindingContext = this.getView().getModel().createEntry("/EntitySet");
sap.ui.getCore().byId("aaaa").setBindingContext(oBindingContext);
sap.ui.getCore().byId("aaaaa").setBindingContext(oBindingContext);

Regards.

0 Kudos

Thanks Cristian, let me check on this.