on 06-29-2007 12:17 PM
Hi All,
I am having a problem with deleting records from the table.
I am not using any checkboxes, but using the default selection provided by webdynpro tables. Now, how do I need to select multiple records and delete them. Also, is there any facility delete all records in the table.
Please do help me and gain reward points.
Regards,
Murthy.
i would suggest a different way, thats how i would do it.
While creating the table, assign a key to each row. This would be a kind of index. now on select of that key, you can use the key value to invalidate that particular row using the regular functionality.
will send u the code after trying it. i have used this key feature to check for multiple selection in checkboxes, i believe we can use the same feature for deleting the row.
Regards
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<b>Hi...
For Deleting All the records without selecting
Try thid code...
wdContext.node<"NodeName">.invalidate();
For Deleting Multiple Selection(ie Only Selected Rows)
Try this Code...
for(int i=wdContext.node<"NodeName">().size()-1;i>=0;i--)
{
if(wdContext.node<"NodeName">().isSelected(i))
{
wdContext.node<NodeName>().removeElement(wdContext.node<"NodeName">().get<"NodeName">ElementAt(i));
}
}
Regards
Chandran</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narayana,
Take a button(say delete) inside view layout.
Inside the actions of the delete button use this code.
try {
for (int i = wdContext.node<put node name here>().size() -1 ; i >= 0 ; --i)
{
if ((!wdContext.node<put node name here>().isMultiSelected(i))
&& (wdContext.node<put node name here>().getLeadSelection()
!= i)) {
continue;
}
else
{
wdContext. node<put node name here >().removeElement(
wdContext node<put node name here>().get<put node name>ElementAt(i));
}
}
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(
"NO RECORD TO DELETE",
false);
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go through the tutorial.It implements the functionality of single and multi row deletion.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/developing%20with%20tables%20in%20web%20dynpro.pdf">Working with tables</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Change the selectionmode property of the Table to 'multi' , then you will be able to select multiple rows. Then delete the multipleselected rows in the table through the corresponding API.
Regards,
Prabhakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi murthy..
U can do this by using invalidate method..
<i><b>wdContext.node<YOUR_NODE>().invalidate();</b></i>
For more Details..
http://www.sappro.com/downloads/WebDynproJava.pdf
URs GS..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For deleting all records, use wdContext.node<TableNode>().invalidate();
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
To delete all the record form the table simply
wdcontext.nodeTable().invalidate();
For multiple selection
Make the selection propty of table =multiple
in code
if(wdContext.nodeTable().getTableElement(i).ism,ultiSelected())// true when the row selected
make sure node selection proprty=o..n or 1..n
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<b>Hi
You can use Invaildate() function to delete all the records in the table
Use this Code in your application
WdContext.<nodename>.invalidate();
Regards
Chandran</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.