on 06-07-2005 12:48 PM
Hi,
I have a WebDynpro application which popoulates a table using the data in a node .
The node has a child node in it.
--EmpDetails
*Name
*EmpID
--Personal Details
*<some details>
*<some details>
*<some details>
The table displays the name and empid and the selection is 1..n.
When a element is selected..
How do i delete the child node elements ALONE when the corresponding parent element selection is made.(for multi-selection of parent nodes)
Regards
Bharathwaj
Message was edited by: Bharathwaj R
hi ,
I think this will solve the problem .. will it !.
if(wdContext.nodeColleaguesData().isMultiSelected(i))
{
wdContext.nodeColleaguesData().setLeadSelection(i);
// and then remove the current element
}
All suggestions are welcome..!
Regards
Bharathwaj
Oops ! Seems like both arrived at the same solution !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sowjanya,
The singleton node has a cardinality of 0..n . So it can store n values ...but at any particular instant it wil store only one.. am i right ?
When i multiselect the parent node elements.. i want the corresponding child node elements to be deleted ...Isn't tat theoretically possible to say that i will load each element value at a time to the singleton child node and then delete it..
If something is wrong with my understanding please do mention where i am getting it wrong ?
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharathwaj,
U have a parent Node of cardniality 0-n and tehn a child node of type Singleton and cardinality 0-n0r 1-1 or..
Now the at runtime the lead selected parent node will have a child instance and that is teh only instance that will exists right even if u multiselected 3 records of teh parent node also the lead selected parent instance will only have a child instance then how will u be able to delete the childnode instances of all the selected ones.So according to my understanding u can only delete the instance of the lead selcted ones and not all teh multiselected records.
Regards,
Sowjanya.
Hi,
Got an idea.
for(int i=0;i<wdContext.nodeVnEmployee().size();i++)
{
if(wdContext.nodeVnEmployee().isMultiSelected(i))
{
wdContext.nodeVnEmployee().setLeadSelection(i);
wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentVnDetailsElement().getVaName());
wdContext.nodeVnDetails().removeElement(wdContext.currentVnDetailsElement());
}
}
U can set the lead selection and then delete.
hello Bharathwaj
see in case of a singleton child node you only get the childnode instance (remember that a node instance is different from node element), not the element under the corresponding parent node and it points to the lead selection of the childnode. ( u will not get an instance of child node from a parent node element).
now if u add a child element under a parent node its actually added to the child node instance. so in order to reach that child element there is no need to go to that parent node element and then traverse to that childnode element. directly u can take the instance and traverse the childnode elements. so if u add N no. of child elements under a parent node, it gets added to the childnode instance which is unique.
regards,
Piyush
Hi Sowjanya,
The method you have suggested will work only in the case of non-singleton child nodes. If i have a singleton chid node how do i remove it ?
(I have edited my question .. ). I dont want to delete the parent element,but i want to remove the child element alone.
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharathwaj,
If u have a child node which is singleton at runtime u will have only one instance of childnode for the parent.Then u will only be able to remove that particular instances again in that case if mutliselected also only the leadselections instance of the parent node will only have teh instance of child node.Then u will only be able to remove that one
for(int i=0;i<wdContext.nodeCompanycode_List().size();i++)
{
wdContext.nodeVnChild().removeElement(wdContext.currentVnChildElement());
}
}
What is the idea behind having both multiselected for parent and having a singleton child node.
Regards,
Sowjanya.
Hi Bharathwaj,
If u want to delete the the child instances on multi slection on that particular action u can write
for(int i=0;i<wdContext.nodeEmpDetails
().size();i++)
{
if(wdContext.nodeEmpDetails().isMultiSelected(i))
{
wdContext.nodeEmpDetails().getEmpDetailsElementAt(i).nodePersonalDetails ().removeElement(wdContext.currentPersonalDetailsElement().currentPersonalDetailsElement());
}
}
Regards,
Sowjanya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be nice if you can post the solution
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.