on 06-09-2008 6:38 PM
hi
i have written this following code
if i have selected one single selection record from one table
and single selection from second table
populate the table else if the
user does multi selection for the first table and
single selection from the second table and click on button
is should throw as message
i have written the following code , its not throwing the error
when i select multiple rows
can any one help me .
if(wdContext.nodeIt_Car_Data().getLeadSelection()!=-1 && wdContext.nodeIt_Carv_Data().getLeadSelection()!=-1)
{
IWDWindowInfo winInfo=wdComponentAPI.getComponentInfo().findInWindows("SimpleMatchWin");
IWDWindow win=wdComponentAPI.getWindowManager().createModalWindow(winInfo);
//win.setTitle("Simple Match");
win.setWindowPosition(200,70);
win.show();
wdContext.currentContextElement().setSMatchWinInstance(win);
IWDMessageManager msg=wdComponentAPI.getMessageManager();
msg.reportMessage(IMessageCustomerComp.NO_MULTI_SELECTION,null,false);
}
// else if(wdContext.nodeIt_Car_Data().getLeadSelection()>0)
// {
// IWDMessageManager msg=wdComponentAPI.getMessageManager();
// msg.reportMessage(IMessageCustomerComp.NO_MULTI_SELECTION,null,false);
// }
Hi Kishore ,
use this code
int count1=0;
int count2=0;
for(int i=0;i<wdContext.nodeTable1().size();i++){
if(wdContext.nodeTable1().isMultiSelected(i))
count1++;
}
for(int i=0;i<wdContext.nodeTable2().size();i++){
if(wdContext.nodeTable2().isMultiSelected(i))
count2++;
}
if(count1>1 || count2>2){
msg.reportMessage(IMessageCustomerComp.NO_MULTI_SELECTION,null,false);
} else{
IWDWindowInfo winInfo=wdComponentAPI.getComponentInfo().findInWindows("SimpleMatchWin");
IWDWindow win=wdComponentAPI.getWindowManager().createModalWindow(winInfo);
//win.setTitle("Simple Match");
win.setWindowPosition(200,70);
win.show();
wdContext.currentContextElement().setSMatchWinInstance(win);
IWDMessageManager msg=wdComponentAPI.getMessageManager();
msg.reportMessage(IMessageCustomerComp.NO_MULTI_SELECTION,null,false);
}
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
this is you code..i made some modification check it
if(wdContext.nodeIt_Car_Data().getLeadSelection()!=-1 && wdContext.nodeIt_Carv_Data().getLeadSelection()!=-1)
{
IWDWindowInfo winInfo=wdComponentAPI.getComponentInfo().findInWindows("SimpleMatchWin");
IWDWindow win=wdComponentAPI.getWindowManager().createModalWindow(winInfo);
//win.setTitle("Simple Match");
win.setWindowPosition(200,70);
win.show();
wdContext.currentContextElement().setSMatchWinInstance(win);
int l_count = 0;
for (int i =0;i<=nodeIt_Car_Data().size();i++)
{
* if(wdContext.nodeIt_Car_Data().isSelected(i))*
* {*
* l_count++;*
* }*
}
if(l_count>1)
{
IWDMessageManager msg=wdComponentAPI.getMessageManager();
msg.reportMessage(IMessageCustomerComp.NO_MULTI_SELECTION,null,false);
}
}
// else if(wdContext.nodeIt_Car_Data().getLeadSelection()>0)
// {
// IWDMessageManager msg=wdComponentAPI.getMessageManager();
// msg.reportMessage(IMessageCustomerComp.NO_MULTI_SELECTION,null,false);
// }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishore
Why dont you try setting table's multiple selection property.
1. Set selection mode property of table to multi instead of auto.
2. Set table source node selection property to 0:n
This will allow you to select multiple rows in table
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishore,
Your code is not meeting your requirements right????
Coz in your If Condtion
if(wdContext.nodeIt_Car_Data().getLeadSelection()!=-1 && wdContext.nodeIt_Carv_Data().getLeadSelection()!=-1)
you are checking for the same thing twice???? Please check your logic ones again....
Regards,
Srinivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
9 | |
7 | |
6 | |
6 | |
6 | |
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.