on 07-15-2005 4:50 PM
hi,
i have got a table with a toolbarbutton.
How do I perform the action of the toolbarbutton with the selected row?
I need a delete action.
Do I first have to perform a leadselection action, which puts the selected row in the current RowContext, and then when hitting the button perform the delete with the data stored in my RowContext?
or is there another more elegant way?
is there xtra trouble when allowing a multi-select on the table?
thanx,
matthias
Hi matthias ,
For deleting multiple selected values you can use the following
for(int i=0;i<wdContext.nodeData().size();i++)
{
if(wdContext.nodeData().isMultiSelected( i))
wdContext.nodeData().removeElement(wdContext.nodeData().getElementAt(i));
}
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
Wow! Details so intricate ...But so important ! Great Armin ! :)Never thought abt these details !
But if the index are changing in while we are deleting.. it will throw a indexoutofbounds exception while the whole loop is executed...
But it has never happened to me that way ! The deletion had always worked..how is that? Is it like it deletes them first from a copy of values and then commits them ...
Message was edited by: Bharathwaj R
What should be "a more elegant way"?
In the action handler of the toolbar button, check which table rows (node elements) are (lead or multi-) selected and remove them from the node.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes.
First you have select the row that you want to delete and then on click on button you can delete the selected row element.
use
wdContext.node<<NodeName>>().removeElement(wdContext.current<<NodeName>>Element());
Regards, Anilkumar
Message was edited by: Anilkumar Vippagunta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.