on 08-19-2008 1:05 PM
Hi Buddies,
I have implenented the following function to delete Rows of a table:
public void onActionDeleteCustomer(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionDeleteCustomer(ServerEvent)
int n = wdContext.nodeE_Customer().size();
int leadSelected = wdContext.nodeE_Product().getLeadSelection();
for (int i = n-1; i >= 0; --i){
if (wdContext.nodeE_Product().isMultiSelected(i) || leadSelected == i){
wdContext.nodeE_Product().removeElement(wdContext.nodeE_Product().getElementAt(i));
}
}
//@@end
}
Unfortunately, leadSelected appears to be -1 at all times...
Is there anything else I have to take care about when using lead selection??
Thanks, Johannes
Hi,
Just change the pre-decrement operator i to post decrement operator i in your loop and try executing your code.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Johannes,
You are getting the size of nodeE_Customer and leadselection of nodeE_Product. Is this what you intended or is this the reason for surprises?
public void onActionDeleteCustomer(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionDeleteCustomer(ServerEvent)
int n = wdContext.nodeE_Customer().size();
int leadSelected = wdContext.nodeE_Product().getLeadSelection();
for (int i = n-1; i >= 0; --i){
if (wdContext.nodeE_Product().isMultiSelected(i) || leadSelected == i){
wdContext.nodeE_Product().removeElement(wdContext.nodeE_Product().getElementAt(i));
}
}
//@@end
}
Vishwas.
I checked and found out that
public void onActionOnLeadselection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionOnLeadselection(ServerEvent)
int p = wdContext.nodeE_Customer().getLeadSelection();
//@@end
}
returns the correct value... Whys the value -1 in the other function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.