From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Need Advice] Track Event for Array of Cluster with String Array and Buttons

Solved!
Go to solution

[VI Attached]

 

Hello everyone!

Would like to gather ideas (the simpler the better!) from everyone and greatly appreciate for your inputs.

I have created custom control as below:

2021-11-21_23h23_48.png

 

How can I effectively track which button is clicked (between Edit and Remove) and from which row of the array?

Another approaches on how to achieve similar functionality (display all data with option to edit or remove one of them) are very welcome too!

-> Event can track up to User Lists only

-> Iterate through the whole list seems no very effective

 

Thank you 😄
[I am trying to make the sentence short and simple. Hope I provide sufficient information]

0 Kudos
Message 1 of 6
(1,503 Views)
Solution
Accepted by topic author kwsoo

Hi kwsoo,

 


@kwsoo wrote:

Would like to gather ideas (the simpler the better!) from everyone and greatly appreciate for your inputs.


Compare "new value" and "old value" of the array to easily find the different item! You get both data from the event case…

 

I suggest a slightly different UI:

  • I prefer (multicolumn) listbox to present such data tables (like yours) to the user.
  • The user can right-click the items in the listbox and select "Edit"/"Remove" from a (custom) context menu…
  • The user can left-click a row in the listbox to select it and "Edit"/"Remove" that row from buttons/control next to the listbox…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,485 Views)
Solution
Accepted by topic author kwsoo

@kwsoo wrote:

 

-> Iterate through the whole list seems no very effective


One way or another, you need to find what changed. Here's what I typically do:

 

altenbach_0-1637514172034.png

 

Message 3 of 6
(1,484 Views)

I agree with Gerd that a listbox is probably better (... but that depends on many unknown factors of your particular use case!).

 

Here's a quick draft.

 

Some additional ideas:

  1. Maybe the "selected data" cluster could be a control that you fill with the selected row of the listbox (via local variable) and the fields can then be edited. A "value change" would update the dataset. (make sure to set the strings to "limit to single line"). You can disable fields that should note be touched by the user.
  2. Maybe a double-click on an item could remove it. (there is an event for that!)
  3. With (1) and (2) implemented, no buttons (or custom menus) are needed at all.

 

0 Kudos
Message 4 of 6
(1,465 Views)

Thank you to both of you!

Kudos + Solution marked!

 

Moving forward is just as some insight/discussion on what is going on.

 

Actually the end user is using touch panel to interface with the VI.

One of the feature is to list out the users so he can modify and remove accordingly.

I feel like the design I provide above is kind of common practice but i am not sure is there a better/easier/fancier way to accomplish similar thing.

as it is a touch panel, button kind of UI would be easier i think 😕

0 Kudos
Message 5 of 6
(1,398 Views)

Hi kwsoo,

 


@kwsoo wrote:

I feel like the design I provide above is kind of common practice


Can you name/show any other (reasonable) software using an "array of clusters" in its UI, especially for touch panels?

Try to learn from other UI designers...  🙂

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(1,387 Views)