Flutterflow and Supabase: How do I filter one ListView in flutterflow based on the selected item in a parent ListView with data supplied by Supabase? - flutter

How do I filter one ListView in flutterflow based on the selected item in a parent ListView with data supplied by Supabase?
I have two tables in Supabase (singers, songs) that are linked by the Singer ID. In Flutterflow I have a ListView that has a backend query to the Singers. I want to add another ListView within the first ListView to display a list of the songs from the songs table. How would I filter the backend query on the second ListView to filter based on the selected item in the first ListView?
I tried to filter but cannot work out how best to do this. Within the first ListView i have multiple containers. There is a separate container containing the second ListView that I am attempting to bind to the Songs table filtered by the singer in the first ListView.
Note: I am using Flutterflow rather than native Flutter

Ok i've answered my own question.
Firstly when creating the songs table in Supabase I did not create the policy. Each table in Supabase needs a policy.
Next, edit the backend query on the second ListView. Add in a filter.
For Field Name, choose Singer, the ID in the Songs table that links to the Singers table.
For Relation choose Equal To For Value Source choose From Variable Then choose ID from the Singers table.
The filter knows that a particular singer is selected from the parent ListView and filters as such.

Related

Create ListTiles dynamically without a builder

I have a custom-filled ListView which I need to display various types of information (I know, ListView with custom-generated ListTiles is probably not the right way to go.) But I want to create some ListTiles depending on the amount of Elements I get from another List (usually 1-3 with a max of 4).
I want to display many various Items on those ListTiles and want to know how I do this the best way.
My first approach would be creating a new List tile with a for loop and fill it with the data for each entry from the other List.
Like so:
Create ListView
Create ListTiles for descriptions
Create ListTile with a checkbox to tick sth off
Get integers from json into an Array
create an additional ListTile for each of those Integers

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.

How to find the scope of data to be shown in ListView

I have a List that contains a huge amount of data. So filtering on text change is a little bit slow. So I thought that why should i filter all the data at a time. I want to filter limited data which will be shown in ListView. Now the question is how can i know that when ListView will ask for the next 20 data from a specific index?
More explanation:
I have a ListView name list, an adapter, a List which contains 20 thousand data, and a small list(filtered). I override getView and provide data from the filtered list.
What I want to do?:
When ListView needs data (a scroll or new data event occurred), filter or search in the big list until i will get next 20 or 25 data, then set them in the filtered list and show them in listView using getView. So how could i know that when listView will need the next or previous 20 data?
You first do sort all data then pass sorted data to a adapter and use ViewHolder pattern. Do not use sort in a adapter. A adapter itself calls visible indexes data in listview.
ViewHolder links:
http://myandroidsolutions.blogspot.com/2012/07/android-listview-tutorial.html
Faster loading ListView, faster than the Viewholder method
Creating ViewHolders for ListViews with different item layouts
if you need current get visible range of listview, you can set OnScrollListener to listview and here you can get visible range and you can call notifyDataChanges method of adapter for update listview.

how to relate a flextable row with a database row in gwt

i'm creating a simple project to try gwt, but i'm a real noob :)
i've a table in my db, each row in this table has a unique id.
i want my application to read this table and display it's contents in a flextable, omitting the column containing the unique id in the db, 'cause the user is not interested in that id.
after that, i want the user to click on a row of the flextable and get a detailed view... but i need my unique id to get the detailed data about that row in my db!
i'm able to determine in which cell of the flextable the user clicked, so i created a simple widget with a string property and an int property, and i add this widget to the flextable setting the string property to the text from the db i want to display in the flextable and the int property with the db id value... when the user clicks, i get the widget contained in the cell and i can get my id back... but it looks like a very complex solution.
Creating a custom widget is the way to go as soon as your requirements exceed the functionality of the standard widgets provided by GWT.
Note: you may want to reconsider and use Grid instead of FlexTable. Grid seems better in your case since each row contains the same number of cells. See related topic about Grid and FlexTable comparison.

Have a jcombobox filter a jtable

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.