on 05-13-2009 6:07 AM
Hi,
How to delete records from table/node in web dynpro frontend without deleting the actual records in sap backend system ?
Thanks,
Namarata.
hi
if you are deleting the record from the table node on leadSelection of the table
then
int leadselection =wdcontext.nodeTableNodeName.getLeadSelection();
for(int i=0;i<wdcontext .nodeTableNode.size;i++)
{
if(wdcontext.nodeTableNodeName.isSelected(i) || leadselection==i)
{
IprivateViewName.IContextElement element = wdcoontext.nodeTablenodename.createtablenodenameelement();
wdcontext.nodetablenodename.removeelement(element);
}
}
try this should solve your problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just delete the node element directly from the node.Refer the below code.
Create one button & bind action to it.Implement the below code in the action method.
int i = wdContext.nodeXXX().getLeadSelection();
IWDNodeElement ele = wdContext.nodeXXX().getElementAt(i);
wdContext.nodeXXX().removeElement(ele);
XXX = node to which table is binded.
Hope it helps.
Regards
Shruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Namrata,
To delete records from table/node in web dynpro, use the following code in your action:
{
int tablesize = wdContext.nodeTable().size(); // This would give the size of the table
int leadSelection = wdContext.node<TableName>().getLeadSelection(); // To lead select every node of the table
for (int i = 0; i < tablesize; i++)
{
if (<Condition>)
{
wdContext.node<TableName>().removeElement(wdContext.node<TableName>).getElementAt(i));
// This would delete the particular node of the table from front end.
}
}
}
I hope this solves your purpose, If you are looking for something else, please revert back, I'll be happy to help you.
Cheers!!!
Umang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Write the following code.
public void onActiondelete(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiondelete(ServerEvent)
int n = wdContext.nodeTable().size();
int leadSelected = wdContext.nodeTable().getLeadSelection();
// loop backwards to avoid index troubles
for (int i = n - 1; i >= 0; --i) {
if (wdContext.nodeTable().isMultiSelected(i) || leadSelected == i) {
wdContext.nodeTable().removeElement(
wdContext.nodeTable().getElementAt(i));
}
}
//@@end
}
Thanks
Abhilasha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.