LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multicolumn Listbox POP-UP

Solved!
Go to solution

Hello guys,

 

I have a listbox representing database items, i added a search bar that searches for items by name, when i press the button search, the vi goes to find any matches then extracts them from the listbox and from there a pop-up should open displaying the results.

the pop-up is working perfectly however the listbox is always empty (knowing that items were found in the listbox).

i attached a snippet of the code specific to this part. i am wondering if anyone had this problem before and can help me figure out why nothing is showing?

 

Thank you 

0 Kudos
Message 1 of 4
(2,520 Views)

Hi fadihajj

 

What is the empty listbox? If it is the Search by description, the problem is that you every iteration clear the shift register, you need to reinitialize the shift register out of loop while.

 

A suggestion to you, you try to use event structure when you have a User Interface. I attach a project that I hope it helps you for your problem.

 

Tell me your comments please.

0 Kudos
Message 2 of 4
(2,469 Views)

Hello carlos and thank you for your reply,

 

The listbox used in the pop-up is the search by description, theres an event structure that detects value change of the input array and the initialization is only supposed to re-initialize to default after every run of the pop-up ( because it is placed outside of the while loop).

i have the same structure used for another pop-up however this one accepts an NSV and is working perfectly fine. 

So the only difference between the two pop-ups is the type of input.

i used an indicator at the input of the Sub-VI in my VI and the indicator is not empty. However, an indicator used to view the array inside the sub-vi is always empty.

the only case where i got to see any output was when i run the VI and search for an element and its not until after the VI has stopped that i open the sub-vi and find values in the table.

0 Kudos
Message 3 of 4
(2,460 Views)
Solution
Accepted by topic author fadihajj

Hello guys,

 

First, Carlos i am sorry i wasn't able to check your code, because i couldn't have access to my PC that has LV 2017 but i was still able to solve the issue. ( currently using LV 14)

 

What i did is: 

1. have the listbox control inside the event structure.

2. add an indicator to use for Value change event that is placed inside the while loop.

3. finally, in order for the listbox to show any values i had to write value to it outside of the while loop. i am not sure why this solved this, but whenever the property node is inside the while loop and event structure the values do not appear until the POP-UP stops execution. so have the property node writing to the listbox execute at the very beginning.

 

Kindly find pictures of the solution.

Thank you. 

0 Kudos
Message 4 of 4
(2,442 Views)