How to add button for each row in table? - labview

Labview,
i would like to add button for each row in table and this button depends on number of rows of data in the table,Button will add programatically in each row.
Reference Image: Cross button

When do you say "Table", Are you referring to "Multi-Column ListBox" or "Table Control" or Individual 1D arrays that are arranged like a Table? There are many ways you can do this!
An array of Clusters as Dave_St suggested.
Using a Table control & Boolean Array.
Using a Table control & Array of Picture Ring.
Using individual 1D Arrays Arranged like a Table.
I'd recommend the first method. Since it makes data handling pretty easy!
But If you're going to go with any other method! You can make your boolean array background as white/transparent and place on top of a Table Column!
Example:
In the above image, I used a Table Control and an array of Picture ring. But you need to synchronize both your array's scrolling positions! Only then the user shall be able to see the correct status for the row.
It seems like you're trying to imitate a webpage form! If you want to dynamically add controls/indicators to your VI check out VI Scripting! But I'm not sure whether VI Scripting will satisfy your requirement.

There are a couple of other ways to get this behavior. However, the array of clusters is probably the easiest. Two other ways to do it are:
Use the glyph (symbol) functionality of a table or multicolumn listbox
Create a data grid or use the DataGrid QControl.
P.S. You currently cannot programmatically add controls/indicators during run time. So VI Scripting won't help you there.

Related

Issue on hiding multiple columns with NatTable

I need to programmatically hide multiple columns of a NatTable.
To do that, I compute an array of indices with a method and then I
invoke the MultiHideCommand as follows.
int[] indexArray = idxToHide.stream().mapToInt(i -> i).toArray();
_tableView.doCommand(new MultiColumnHideCommand(_tableView,indexArray));
What I get is that only a bunch of columns are hidden, but not all the columns in the indexArray.
I read that the ColumnHideShowLayer has been designed with UI interaction in mind.
Is there a right way to programmatically remove multiple columns?
First, the command takes the positions as parameter, not the indexes. Second, the positions need to be based on the layer that is used as first parameter. If a ViewportLayer is involved, non-visible columns won't be taken into account.
So you could try to calculate the positions based on some lower layer, e.g. the SelectionLayer, and then pass in the SelectionLayer and the positions based on the SelectionLayer on the command. That should work in theory.

Make Spotfire ignore empty values in the categories of charts and show a visualization without "spaces" between the bars

I have a group of trellis graphs on some data, in there you can see a numeric variable on the Y axis and a series of cell dishes on the X axis. Not all the numeric values are present on all the series of cells. Because of this the visualization results in a graph with empty spaces:
This is OK most of the time but the thing is I would like to avoid the "empty spaces, only in these graph series, that you can see between the bars. I would like to see showing only the pattern of the cell dishes where I have data.
Trying to do so I tried creating a calculated column to use it as a ordering index (https://docs.tibco.com/pub/sfire-bauthor/7.9.0/doc/html/en-US/GUID-8CAA18D0-CF28-4707-9945-041BDFD99E99.html) (Sorting Filter values asc/desc on Tibco Spotfire), after that "Limit data by expression" using a "[MyColumn] is not null" on it (https://community.tibco.com/questions/can-i-automatically-make-spotfire-ignore-empty-values-categories-charts) (How to show the top 10 column values in Spotfire) with no luck and I tried also (https://docs.tibco.com/pub/spotfire/6.5.1/doc/html/ncfe/ncfe_details_on_custom_expression.htm) create a custom expression, which I think it would be a good solution because I understand it will only affect these graphs and not the complete set of visualizations but no, I don't reach the point to change it. Last that it should work but it doesn't is to "Show/Hide Items" under a Boolean expression that it would include that "[Axis.Value] is not NULL" and "Apply individually for each trellis panel" of the numeric column which sound terrific but... nope, it didn't work either...
Any help would be appreciated, now I will select one by one on individual graphs extracting them and plotting them in other place but this is not very useful as a "large scale" solution. I am sure there is a way to insert a proper expression to avoid the null values of the cross of both variables, the numeric and the cell dishes.
this is because you are trellising data, not the axis. you won't be able to filter out values on the x axis; it's simply not how trellis works.
using multiple visualizations is the solution, but I assume you've got n sets of categories that you want to separate out without creating a ton of charts on the page and perhaps you can't guarantee the number of categories or their names, so you want to build a flexible solution.
please check out an answer I just wrote over here which illustrates how to use a document property and a property control to limit a visualization. your property control can be linked to automatically and dynamically display unique values in your "category" column (the one you are trellising by). maybe this can be a solution for you?

How can I see all the key-value pairs in the `myShape.Cells()`?

I'm recently programming with the VB in the Visio.
I'm really curious about the myShape.Cells("Width") and myShape.Cells("PinX"), I mean the .Cells("...") part of the code. My program has used them very many times.
I want to know more about them, but I can't find any specific explanation about this.
Who definites it, and what are all of the key-value pairs in the .Cells().
I've seen someones in this site using someShape.Cells["Width"] to point to the value of the shape's width.
So:
I want to know if the .Cells() is an collection or map(dictionary) in reality. Please give me some explanation or files that I can read for help.
I've tried to put the myShape.Cells or myShape.Cells() in the watch window, but it didn't work. It told me something wrong..
So How can I have a look at all the key-value pairs in the .Cells(), it will be a great help to give me some codes that I can use to show the key-value pairs in the immediate window.
Thanks a lot.
There are two ways of accessing ShapeSheet cells in Visio. One is by name, using the Shape.Cells (or CellsU) method you mention, and the other is by index using Shape.CellsSRC. The second method reveals how cells are structured, by Section, Row and Column. Note that slightly confusingly, the SRC structure is not necessarily an exact replica of the cells you can see when you open the ShapeSheet in the UI, which is organised into something that's a little more user friendly.
The SRC indices are usually expressed as enums, which you can look up in the SDK along with the cell Name equivilent.
So to answer your questions more directly:
Is .Cells a collection - not one that you can call and retrieve all values. You can loop through the cells using CellsSRC but you'll discover that the cells are not necessarily contiguous, plus there are a number of unnamed or internal cells that you can't use via the api. For further details you might find this link useful https://msdn.microsoft.com/en-us/library/aa201764%28v=office.10%29.aspx
myShape.Cells() doesn't work - The cells method takes a single parameter, which is the string name of the cell. This is often, but not always, the name you see in the ShapeSheet window. Otherwise you have to look up the name in the docs - Cells reference
One last point is that you should try and use the CellsU method rather than the Cells one. The former accesses the cell names using universal syntax where the latter uses local syntax, which may differ across different locales.

Best way to handle multi-valued fields as a view/grid

In several notes applications, instead of handling related data as separate documents, if the size of the data is small (less than the 32k limit), I'll make several multi valued fields and display it in what I call a "List Panel". It's a table where each column displays one multi-value field. Since fielda(1) goes with fieldb(1) that goes with fieldc(1) there is a concept of rows. (I did a similar thing in my auditing routine discussed here )
It is always assumed that each field has exactly the same number of elements.
All the multi-value fields are then stored on the single document. This avoids several coding conventions that made my eyes bleed like having date changed, who changed it, new value fields for each field we wanted to audit. Another thing that this kept to a minimum was having to provide multiple fields for the same thing that locked you into a limit. Taxrate1, Taxrate2, Taxrate3, etc...
In my "Listpanel" the first column is a vertical checkbox. (One for each element in my lists) This is so I can select one item to bring up and edit, or select multiple values to delete "rows" or apply some kind of mass change to them.
What would be the best way to handle this under xPages to get this functionality? I tried making a table but am having the devil of a time to get the checkboxes to line up with their corresponding data items.
Views and dojo-grids seem to assume we're using a document for each row.....
This TableWalker may provide what you want http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23
It was created when XPages was all very new, so it's SSJS rather than Java. But if you're comfortable wiith Java, converting it probably won't be a challenge.
You could use a repeat control to display the values and build a table using the table row tags in the repeat. You would want to calculate the id of the checkbox to be able to take an action on that selected row. The repeat var would be just one of your multi-value fields and you use the index of the repeat to get the value for that row from the other multi-value fields.

how to prevent some columns from being highlighted when selecting a row

I have a semi-dynamically created window ( and use PowerBuilder 10.5 ). Now there are a couple of columns which can have different colours and I want to see those colours when selecting a row. However I don't know how to deselect these columns and have the first couple of columns remain selected.
The highlight function in our application just does a dw.selectrow( x, true ).
Regards,
Marinus
I don't think you'll get what you want using selectrow. If you don't need multiple selections you could change the background of the current row with an expression in the datawindow. If you want some columns to stay normal you could do that with a rectangle behind the ones you want to highlight instead of changing the row color. If you need multiple rows highlighted you will have to simulate multi-select by adding a dummy column and using that to control the background, and of course you need to handle the selecting and deselecting in the clicked event. If you've got code that deals with selected rows you'll have to change them to use the new scheme, for example by checking the value in your dummy column.
If you want to use SelectRow(), maybe use of SetRowFocusIndicator() would help. IIRC (it's been pretty close to decade*s* since I've used it), it disables the row colouring in favour of the new method.
The other way that comes to mind is setting an expression for background colour that uses GetRow() and CurrentRow(). This wouldn't be my first choice, as it doesn't let users with vision impairment choose their colours through standard Windows colour selection to something they can deal with, but if you're dead set on colour indications on selective columns, this would be the way to go.
Good luck,
Terry.