cancel
Showing results for 
Search instead for 
Did you mean: 

Enter Blank Editable fields in a table SAP UI5

meenakshi_raina
Advisor
Advisor
0 Kudos

Hi,

I have created a table and added an option to add a blank row on click of "Create Entry" Button. I am able to add a blank row, but it is not editable. Kindly help me with this.

former_member467961
Participant
0 Kudos

Hello,

There is already a blogpost which you can use for reference.

Best Regards,

Bopanna

Accepted Solutions (1)

Accepted Solutions (1)

Abdul_Waheed
Contributor
0 Kudos

Remove <items> </items> from XML.

Create & bind template at run time.

this.oTemplate = new sap.m.ColumnListItem({ cells: [ new sap.m.Text({ text: "{ITMU}" }),new sap.m.Text({ text: "{PRMU}" }), ..............] });

this._oTable.bindItems({ path: "/CNST_ER", template: this.oTemplate });

meenakshi_raina
Advisor
Advisor
0 Kudos

@Abdul WaheedI am sorry, but the result has not changed. Only a blank row is added, which is not editable.

meenakshi_raina
Advisor
Advisor
0 Kudos

Thanks for your inputs. The issue is resolved. Instead of sap.m.Text, I used sap.m.Input. Now I am able to edit the fields properly. Thank you @Abdul Waheed

Answers (2)

Answers (2)

meenakshi_raina
Advisor
Advisor
0 Kudos

@Bopanna D C I saw this one. But it is only adding blank rows, which are not editable.

Abdul_Waheed
Contributor
0 Kudos

Hello Meenakshi,

You need bind template to table.

For example.

this._oTable.bindItems({ path: "/CNST_ER", template: this.oTemplate });

this.oTemplate will be a sap.m.ColumnListItem

meenakshi_raina
Advisor
Advisor
0 Kudos

Hi @Abdul Waheed, Thanks for your reply. I have added the below code. I am not sure where am I suppose to bind template with table ?