cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle Event when more that 2 rows are selected in a WD Table

Former Member
0 Kudos

Hello WD developers,

I need your assistance.

My case is as following:

I have a WD table populated with data.

I also have several buttons in the toolbar table.

One of those buttons should be enabled only in case that one row (and only one)

is selected in the table otherwise it should be disable.

The problem is that an even is triggered only when the first row is selected

and when the second (third....) are selected no event occur.

Do you have any idea How can I solve this issue.

Thnaks in advance for your help.

Regards

Harry

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Lohi,

My problem is not how to define the Enable/Disable state of the Button.

I know how to do this.

I want to be able analysing when more than one row is selected.

Thank you for your help.

Harry

Former Member
0 Kudos

As there is no event triggered on multi-selection, this is not possible.

Armin

lajitha_menon
Contributor
0 Kudos

Hi Harry,

Are you saying that the onLeadSelect event on the table is only triggerred for the first row??

LM

Former Member
0 Kudos

Hi,

Yes it seems to me that this is what happen..

When you perform a multi selection only the first row selection can trigger the onLeadSelect.

Thanks

Harry

lajitha_menon
Contributor
0 Kudos

Hi Harry,

Check few things

- Is selectionMode for table given as multi

- Is selection cardinality for the context node given as 0..n or 1..n

- If I remember it right, you have to double click on a line to select it when multiselection is done(Others,Correct me if I am wrong) - Are you doing this?

-Better way would be to give a single value attribute of type boolean on your datasource node. Map it to the table as a checkbox. Users can select the line by clicking on the checkbox(You can set the selectionMode of the table to none so that the default selection checkbox is hidden). you can get all lines selected by iterating on the node and checking the boolean value.

And you can use the onToggle event of the checkbox to enable/disable the button.

Hope this helps,

Regards,

Message was edited by:

L Menon

Former Member
0 Kudos

Hi,

thank you for your answer I will try to implement the second option you have mentioned below:

<-Better way would be to give a single value attribute of type boolean on your datasource node. Map it to the table as a checkbox. Users can select the line by clicking on the checkbox(You can set the selectionMode of the table to none so that the default selection checkbox is hidden). you can get all lines selected by iterating on the node and checking the boolean value.

And you can use the onToggle event of the checkbox to enable/disable the button>

many thanks

Harry

Former Member
0 Kudos

Hi,

try this link.

thanks,

Lohi.

Former Member
0 Kudos

Hi,

In the Onlead selection of table make it visible and invisble of your buttons as per your selection.

The table have single selection and multi seletion options are availble when you defing the table you can find this options in the properties of the table.

In onlead selection your button to be mapped with attribute WDVisble.

And based on your selection you can visible and invisible.

wdContext.currentContextElement.set<attribute>(WDVisble.Visble);

and

wdContext.currentContextElement.set<attribute>(WDVisble.NONE);

This might helps you.

Do you need more post your issues.

Thanks,

Lohi