cancel
Showing results for 
Search instead for 
Did you mean: 

table multi selection

Former Member
0 Kudos

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);

// }

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

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

snehal_kendre
Active Contributor
0 Kudos

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);

// }

Former Member
0 Kudos

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

srinivas_sistu
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

hi

the conditions i have written is correct ,

the table names are different , condition is if some thing

is selected show the window and if u have selected multiple

rows show the error.

Former Member
0 Kudos

Hi,

If i understand your problem, you can go through the elements and verify if they are selected.

Try a code like it.

Regards