on 03-17-2006 6:58 AM
Hello togehter,
I have implement the following code:
ResultSet resultSet;
resultSet = statement.executeQuery("select NAME from DNPERSO where COST like'" + InputFildKostStelle "%' or SNAME like'" InputFildName+"%'");
while (resultSet.next()){
ISelectionPersonsElement selection = wdContext.createSelectionPersonsElement();
selection.setPersons(resultSet.getString(1));
wdContext.nodeSelectionPersons().addElement(selection);
}
I use this for a search-funktion and it works fine.
My problem is now that I want to write an method to remove all the added elements of the "SelectionPersons Node".
Can anybody help me?
Patrick
Hi Patrick,
Try this:
for(int counter=(wdContext.nodeSelectionPersons().size-1);counter>=0;counter--) {
wdContext.nodeSelectionPersons().removeElement(wdContext.nodeSelectionPersons().getElementAt(counter));
}
Thanks and regards
RK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Patrick,
You can remove the elements from the node in the following two ways.One way is to invalidate the node and the other way is to remove the elements using the
removeElement()
method of the node.
Examples:
First method:
wdContext.nodeSelectionPersons().invalidate
This will work well for your Value Nodes. However, for model nodes just bind suitable structure to the node and bind the instance of child node to the suitable parent nodes.
Second Method:
for ( int idx = ( wdContext.nodeSelectionPersons().size - 1 ); idx >= 0; idx-- )
{
wdContext.nodeSelectionPersons
().removeElement(wdContext.nodeSelectionPersons().getSelectionPersonsElementAt(idx));
}
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works,
thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If u want to remove all the element just write this code:
wdContext.node<name>().invalidate();
this will invalidate all the elements of the node.
If u want to remove a specific element from the node there is a method like remove():
wdContext.node<name>().removeElement();
Regards,
Piyush.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.