cancel
Showing results for 
Search instead for 
Did you mean: 

Need help regarding discarding of table data when a new data is popped up

Former Member
0 Kudos

hi,

i have a problem with table UI.

I have a search criteria and creating the table dynamically for the search criteria.

when i want new search critieria, the dynamically created table is giving problem like

duplicate node , node already exists, cannot add same duplicate child node.

i want the previous dynamically created node to be discarded and new search criteria node should be bind to table when an action button is clicked

can anyone help it out.

wdContext.node<bean>.invalidate();

won't work it out in this case as i need to refresh the table data, which is dynamically created.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

when i am using the wdContext.getContext.reset(false);

following error is generated.

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: View: Cannot add element with duplicate ID "Caption" of type com.sap.tc.webdynpro.clientserver.uielib.standard.impl.Caption

at com.sap.tc.webdynpro.progmodel.view.View.addElement(View.java:702)

at com.sap.tc.webdynpro.progmodel.view.ViewElement.<init>(ViewElement.java:40)

at com.sap.tc.webdynpro.progmodel.view.UIElement.<init>(UIElement.java:168)

at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractCaption.<init>(AbstractCaption.java:83)

at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.Caption.<init>(Caption.java:86)

Former Member
0 Kudos

dharmendra,

This is because you are progressing further (deeper) in your code

You may not use same ID for UI controls.

Also when you call destroy() on UI control the ID is released, so you may use it again. However, it seems that you call remove() on UI control's parent but not destroy() on control itself. Btw, this causes memory leaks.

Another advise: never supply concrete element ID in createElement, use

ui_control = wdView.createElement(class, null);

WD will assign unique ID automatically. You may read its value later via ui_control.getId();

VS

Former Member
0 Kudos

thank you valery,

my problem solved

Answers (2)

Answers (2)

Former Member
0 Kudos

dharmendra,

Use wdContext.reset(false);

Bala

Former Member
0 Kudos

dharmendra,

wdContext.getContext().reset(false)

This will remove all dynamically created node / attributes (i.e. structure or metadata).

node.invlidate() removes only elements from node (i.e. data).

VS