cancel
Showing results for 
Search instead for 
Did you mean: 

ItemListBox: at least one item always selected?

Former Member
0 Kudos

Hi, I have a problem with ItemListBox in my current application. At first the items appear unselected, but as soon as I select one of them there's no way to unselect them. I mean, I do it by pressing the control key while clicking on a selected item, but as soon as there is a round trip the item appears selected again.

The node has a selection property of 0:n, a cardinality of 0:n, and the ItemListBox allows multiple selection. Selection change behaviour is set to auto, (but tried with manual too with the same result).

Is there any reason why this should happen? Is it perhaps a bug of this UI element?

Thanks in advance.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

set

intializedLeadSelection = false

and write following in

wdDoModifyView()

wdContext.node<ABC>().setLeadSelection(IWDNode.NO_SELECTION);

it will work for ur requirement.

Thanks

Deepak

Former Member
0 Kudos

Adding buttons or empty elements is my last resort for doing it, but frankly I would like to avoid this because I'd like to make it transparent for the user. What I want to do is just to use the ItemListBox as it is (or should be) intended

By the way did nobody else encountered this same problem with this UI element?

Deepak clearing the lead selection doesn't work. It looks like there is no lead selection, but it keeps as selected (no lead, but as a multiple selection element) the last item that the user unselected.

Thanks all for your interest.

Former Member
0 Kudos

Hi Eduardo,

Try adding an empty element into the Itemlistbox. So each time the user want to clear his selection he can click that first empty row. I havent tried this, but it shud work.

Or you can have a clear button to clear off the selections.

Hope this helps.

--MLS

Former Member
0 Kudos

Hi,

create a button with name "clear", bind an action Clear

In OnActionClear(){

wdContext.nodeXx().clearselection();

}

Regards,

Naga

Former Member
0 Kudos

You can do as follows:

wdContext.node<name>.setLeadSelection(-1);

Former Member
0 Kudos

I haven't still found a solution to this problem. I'm dealing with multiples selections of a multiple selection node so I can't just change the lead selection with wdContext.node<name>.setLeadSelection(-1); .

I know I can clear all the selections with wdContext.nodeXX().clearSelection(); but the problem is when to do it? The ItemListBox doesn't react to the onLeadSelect events if you allow multiple selections which is the case.

The problem is that the ItemListBox works well unselecting items as long as there is at least one left. But when you unselect the last item it gets selected again in the next round trip, and I have no way to detect the unselection of this last item because onLeadSelect doesn't work.

If anyone has any other idea it will be very welcome. Thanks for your interest.

Former Member
0 Kudos

Hi

Try to use wdContext.nodeXX().clearSelection(); in onPlugFromXX()

so that when ever you navigate from one view to another view nothing will be selected in the listitem

Regards

Chaitanya.A

Former Member
0 Kudos

The problem is not to have the list cleared at the start, it is to allow the user to clear his own selections within the scope of the same view (without navigations).

Former Member
0 Kudos

Hi

have you tried clearing in wdDoModifyView()

Regards

Chaitanya.A

Former Member
0 Kudos

With what condition? If I do it always the user won't be able to select any item at all.

Former Member
0 Kudos

Hi,

you can remove the selection by using

wdContext.nodeXX().clearSelection();

Regards,

Naga

Former Member
0 Kudos

Hi Eduardo,

Can you please let me know if you were you able to find a solution for this ?

If yes, can you please share it with us.

Thanks,

Vivek