cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the row entries

Former Member
0 Kudos

HI,

I have a row entry which contains radio button,dropdown,input field,calender.All the fields are dynamic

All these fields(UI elements) are in one line and these are not in the table.If I add new entry(by clicking NEW ENTRY button),then a new row will be added dynamically with the same UI elements in the new row.Means every new row entry contains radio button,dropdown,input field,calender.

Problem :- I want to delete one row entries.Means if I delete the 5th row entries,then it should remove all the UI elements(radio button,dropdown,input field,calender) from that 5th row entries only.

I think I am clear about the requirement.

Please suggest me how to remove a row entry.These UI elemenets are not table entry.

Regards

-Sandip

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sandeep,

You can use the below code for deleting a row from table.

int n = wdContext.nodeProducts().size();//size of node binded with table
int leadSelected = wdContext.nodeProducts().getLeadSelection();
// loop backwards to avoid index troubles
for (int i = n - 1; i >= 0; --i)
{
if (wdContext.nodeProducts().isMultiSelected(i) || leadSelected == i )
{
wdContext.nodeProducts().removeElement(wdContext.nodeProducts().
getElementAt(i))

Hope this will help.

Regards

Narendra

Former Member
0 Kudos

Hi Narendra,

Thanks for reply.As I told this is not a table entry.

All the UI elements are in one row.New rows will be added(with radiobutton,dropdown,calender and input field) dynamically with the click of NEW ENTRY button.

Means every row contains radiobutton,dropdown,calender and input field.

Please suggest.

-Snadip

former_member201361
Active Contributor
0 Kudos

Hi Sandeep,

All the UI elements are in one row.New rows will be added(with radiobutton,dropdown,calender and input field) dynamically with the click of NEW ENTRY button.

Create a Button Say delete in the View and create a action say destroy with a Parameter say "view" of type "com.sap.tc.webdynpro.progmodel.api.IWDView"and bound to the OnAction property of the Action .

Open the Implementation for the OnActionDelete and destroy the view element say "radio button".

for eg :

view.getElement("radio").destroy();

where radio is the id of the Dynamically created Radio button.

Hope this will solve ur problem.

Thanks and Regards

Answers (1)

Answers (1)

sanyev
Active Participant
0 Kudos

Hi Sandip,

I think your requirement can be fulfilled with the RowRepeater UI element. You can go through the this [tutorial.|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0849a4b-07c9-2b10-db83-c83fea06c563]

Hope this helps.

Regards,

Sanyev