Have a jcombobox filter a jtable - netbeans

following this tutorial http://www.netbeans.org/kb/docs/java/gui-db-custom.html#enhancements
it shows how to use a textbox to filter out the master table. Could anyone instruct me on how to do a similiar thing but use a dropdown to test against a specific column?
(ie a dropdown of countries, to filter by the country column?
thanks

depending on what the source is for the dropdown.
i assume the dropdown isn't used as part of the Jtable itself, but merely shows a list of unique data coming from one column of data?
in that case, you could get the Jtable's datamodel, and then walk through all the cells in the particular column, putting them in a hashmap with the string as the key. that way you have a list of (unfiltered) unique strings to use as the datamodel for the dropdownbox.
You could attach a model listener to the talbedatamodel to know when your list has to be updated as well.

Related

MUI DataGrid ColumnDef: the row is not available on the valueOptions prop of the column definition

I am using a DataGridPro component with different columns.
One one the columns is defined like this:
This issue is that I am trying to understand why the row is not available in the valueOptions prop of the column definition.
I would like to be able to populate the choices based on a list that is available on the row in another field.
But I get this error when I try to read the row:
Can you please help? The grid is populated with lots of rows coming from an api fetch.
Every other column is working fine accept this one.
Thank you.
I discovered that it was my bad. My column object was used twice with different parameters and so, yes, the row was not available for the second case.

Get Firebase Auto-ID column in FlutterFlow

Reviewing one of my Firebase schemas I can see that I have a couple of columns, but the auto-generated ID column does not show up:
However, when clicking on "Manage Content" the ID column can be seen:
The problem I have is that in other collections I make a reference to this collection by this ID, however, it doesn't pop-up in FlutterFlow to filter on:
Question: Is it possible to get the Auto-ID column in FlutterFlow?
As far as I know that is unfortunately not possible.
You could solve this by adding a column CopyOfId to your scheme.
You could then write a Firebase Function that triggers when you create a new document (https://firebase.google.com/docs/reference/functions/firebase-functions.firestore.documentbuilder.md?authuser=0#firestoredocumentbuilderoncreate). You could make this function copy the contents of the ID column to your own CopyOfId, making it accessible in FlutterFlow.
A deeper question is maybe for what use case you want this behaviour: why would you need to filter on an autogenerated ID that you do not know the value of - and that you can't access - in FlutterFlow? If we know your use case, there is probably another way to achieve what you want to achieve.

Relate text to Id once selected from text box with suggestion option in rcp

I currently have a text box that can predict String as typed.I used the snippet here .
There are two seprate questions
Q1)In the snippet the suggestion are passed as item but I want to relate the String to an id to update the database. If I just pass the string to snippet I need to do another query to again retrieve the id which costs resources is there a way to pass objects to the auto suggestion which will select the id of whichever name is chosen from the suggestions.
Q2)Also I dont want user to be adding new values so is there a way to force user to chose one of the values from the suggestion for the text box and not add his own values
This might be a workaround for your Q1.
In the auto-complete shell , use a SWT Table instead of combo widget.Have two columns in the table for string and string Id.Hide the second column so that the user cannot see it.You can use this column to retrieve the ids of corresponding strings.
Or simply store the string and string ids in a hash map and give the key values set of this hash map to the combo items.

SAPUI5 table: get none-displayed values of selected row?

I have a SAPUI5 (OpenUI5) application with a table. This table is bound to a (JSON) model and display the name of the entity and some other attribute - but not the technical key.
The user should have the opportunity to select multiple lines in the table and the application should then be able to get the technical keys of the selected lines (probably using the underlying model).
How would I do such a thing?
Thanks in advance!
The rowSelectionChange event has a rowContext attribute. A better approach would be
rowSelectionChange: function(oEvent) {
console.log(oEvent.getParameters().rowContext.getProperty("your_key"));
}
to obtain the value of your key (or any field in the selected row by adapting the getProperty value accordingly)
when you will select a row in a table, there is a event called "rowSelectionChange". Use this event and getSelectedInedx of row.
Using the index value loop over your json and get values selected row.

Grouping expand and collapse in GWT

I have multiple records which needs to be displayed as part of a search. A single result can contain multiple records associated to it. If there are multiple records I need to display the record with (+) and when clicked it further displays the list.
I would like to know what the best way is to implement ( I have checked Custom data grid ex: http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCustomDataGrid but would like to use UI binder)
Once the user selects a record from the expanded list, how can we load that selected record?
Any pointer are appreciated..! ( Currently on GWT 2.2)
Widget list
Tree or maybe StackPanel seems like it would be useful here.