cancel
Showing results for 
Search instead for 
Did you mean: 

Selection in the table

Former Member
0 Kudos

Hi,

Our senerio is as follows:

We need to capture the single selection in the table.

There are three options:

1. No element in the Table(no selection).

2. single selection(one row selected).

3. multiple selection(more than one row selected).

How can we code to differentiate all these??

regards

Anumit

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Try like this..

Hi,

Try this:

int leadSelection = wdContext.nodeZemp_Details().getLeadSelection();

if(leadSelection == -1 )

{

// No Selection

}else{

for(int i=0;i<wdContext.node<nodeName()>.size();i++)

{

if( leadSelection == i || wdContext.node<nodeName()>.isMultiSelected( i ) {

// Multiple Processing.

}

}else{

// Single Selection

}

Thanks n Regards,

Jhansi Miryala

Former Member
0 Kudos

Hi,

Leadselection is getting two values -1 (for no selection) and 0 (single or multiple).

in both case the last two cases are executed.

Regards

Anumit

Former Member
0 Kudos

Hi,

can you explain what you are trying to achieve when multi selection and single selection happens that need to be diffferentiated?

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

I am to enable and disable buttons according to no selection, single selection and multiple selection.

regards

Former Member
0 Kudos

Hi,

based on the leadselection you will be able to find selected or not

if selected create a counter and see the number of elements selected

if counter is equal to one then its single selection

else

multiselection

Regards

Ayyapparaj

Former Member
0 Kudos

It's not possible to react on multi-selection changes because there is no action available. But you can handle changes of the lead-selection by assigning an action to the onLeadSelect event. To change button states, you can use a combination of assigning an empty action and using calculated attributes for controlling the button's "enabled" property.

Armin

Former Member
0 Kudos

Hi,

Try this:

int leadSelection = wdContext.nodeZemp_Details().getLeadSelection();

for(int i=0;i<wdContext.node<nodeName()>.size();i++)

{

if( leadSelection == i || wdContext.node<nodeName()>.isMultiSelected( i ) {

// Processing.

}

}

Thanks n Regards,

Jhansi Miryala

Former Member
0 Kudos

Hi,

Its not enough.

My scnerio is as follows:

if (Sellection== single row)

else.

Regards

Anumit

Former Member
0 Kudos

Hi,

I guess you need some thing as follows


WDTableSelectionMode mode ; //An attribute which is buund to the table selection mode property
	  if( mode.equals(WDTableSelectionMode.MULTI))
	  {
		  //Do respective
	  }
	  else if( mode.equals(WDTableSelectionMode.SINGLE))
	  {
		//Do respective
	  }
	  else
	  {
		//Do respective
	  }

Regards

Ayyapparaj

Former Member
0 Kudos

Hi KV,

here how can we are to get selection from the table(means how to initiate mode local variable).

Regards

Anumit