LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

listbox selection

Hi!

I have following problem with the listbox selection system:

I have to force the user after one selection of first two items to select other than the first two, BUT
when i select the new value from listbox, the "Mouse selection" stays behind and takes item from first two, which it should take it from.

First selection


LISTBOX:

Val1*Usable*  <-select this with mouse
Val2*Usable*
Val3*Not Usable*
Val4*Not Usable*
Val5*Not Usable*

sets some values not usable and then sets the selection to 3rd item.

After first selection

LISTBOX:
Val1*Not Usable*  <- gets value of this
Val2*Not Usable*
Val3*Usable* <- Highlights this
Val4*Usable*
Val5*Usable*

Any easy fix for this one?
0 Kudos
Message 1 of 17
(3,884 Views)

Use a property node of List box with its attributes set to disabled items.

The items at those indices ( specified by disabled items array) shall be disabled on your listbox control

look at attached pic

0 Kudos
Message 2 of 17
(3,870 Views)


@devchander wrote:

Use a property node of List box with its attributes set to disabled items.

The items at those indices ( specified by disabled items array) shall be disabled on your listbox control

look at attached pic



Yes. I have disabled them just like in your picture there, but the last selection with mouse still holds the value rather than the selection i made programatically!
It still selects the disabled item and i consider this a BUG in the program.
0 Kudos
Message 3 of 17
(3,846 Views)
Could you please attach the program that you have built.
Probably we could take a look at it and suggest better
Message 4 of 17
(3,812 Views)

I have to second Dev's request for code that illustrates this behaviour. We do much better at answering Q's when we have code to look at.

We will jump on a bug like a prey mantis once we can see it.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 17
(3,802 Views)
Phase1:
I have only 2 selections to choose from, I choose one of them and press "Lisää Lohko", which means "Add Block".
http://img57.imageshack.us/img57/3609/phase1fj3.png

Phase2:
The selection copied to the left listbox. Then program disables the first 2 selections, so you cant select more than 1 of them.
http://img214.imageshack.us/img214/9505/phase2bx2.png

Phase3:
I just click the "Lisää Lohko"- button, which adds item from the list, but none is selected and it still adds the first item!
Even if i select programatically the 3rd item from the selection list, it still adds the first item if i dont push it with a mouse.
http://img341.imageshack.us/img341/3226/phase3dy5.png

Message Edited by Nallez on 02-21-2007 07:11 AM

0 Kudos
Message 6 of 17
(3,760 Views)
LOHKOLISTA-listbox disabling code:

Phase1 Code for disabling:
http://img64.imageshack.us/img64/952/noitemsgb7.png

Phase2 Code for disabling is similar, but with only [0,1] on the array.

Message Edited by Nallez on 02-21-2007 07:20 AM

0 Kudos
Message 7 of 17
(3,748 Views)
^
0 Kudos
Message 8 of 17
(3,728 Views)

Hi Nallez

One question - why don't you use two different listboxes? In my opinion it is not so userfriendly to enable and disable values of a listbox according to a selection in this listbox.

If you use two listboxes, you can fill the second one with values depending on the selection made in the first one. After performing this selection, you could disable the first listbox, fill the second one and enable it.

 

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 9 of 17
(3,724 Views)


@becktho wrote:

Hi Nallez

One question - why don't you use two different listboxes? In my opinion it is not so userfriendly to enable and disable values of a listbox according to a selection in this listbox.

If you use two listboxes, you can fill the second one with values depending on the selection made in the first one. After performing this selection, you could disable the first listbox, fill the second one and enable it.

 



Because the customer wants it that way.

If customer wants -> he gets. Smiley Very Happy
0 Kudos
Message 10 of 17
(3,721 Views)