StrataFrame Forum

Filtering Records that a Browse Dialog Returns

http://forum.strataframe.net/Topic489.aspx

By Scott - 1/26/2006

Is there a way to have the browse dialog filter the records that it returns other then by what the user enters into the dialog itself? I guess what I am looking for is a way to add to the 'where' clause of the browse dialoge's business object.  We have two tables, table 1 is the main table and table 2 is a child table.  We want to allow the user to ONLY browse for records in the first table that have child records in table 2.

One last thing,  we are getting ready to release our first StrataFrame application.  It is VERY small and only for internal use, but it is a start.  We just have a couple of loose ends and have to figure out how to use the Database Deployment Kit.  Any idea when the docs will be done for it?

Just want to let you know all your hard work is paying off.... for everyone.  Thanks for StrataFrame and all the HELP!

Scott

By StrataFrame Team - 1/27/2006

At the moment, no, there is not a way filter the records within the browse dialog, but this has been a pending enhancement request, and since you're not the first or last person to ask for it (http://forum.strataframe.net/Topic463-6-1.aspx), we'll probably be adding it sometime soon (within the next week or so).



As for the Database Deployment Toolkit documentation... I'm not sure on the timeframe, but it's at the top of our list as well.
By Danny Doobay - 9/8/2012

Any udates on this?
By Ivan George Borges - 9/10/2012

Hi Danny.

Have a look at the help file under "Application Framework" -> "UI Layer" -> "Controls" -> "Browse Dialog" -> "Events", and check the "BeforeSearchExecuted" and the "Searching" events, where you can manipulate how the search will behave right before it happens.
By Danny Doobay - 9/12/2012

I followed the following sample and it did work for me.

Private Sub BrowseDialog1_Searching(ByVal sender As Object, ByVal e As BrowseDialogSearchingEventArgs) Handles BrowseDialog1.Searching        '-- Establish Locals        Dim where As WhereStatement        Dim myFruit As New System.Collections.ArrayList()        '-- Determine which values will be included as part of the "IN" tag        If _AllowApples Then myFruit.Add(CType(Fruit.Apples, Integer))        If _AllowOranges Then myFruit.Add(CType(Fruit.Oranges, Integer))        If _AllowPears Then myFruit.Add(CType(Fruit.Pears, Integer))        '-- Create the where statement.  In this example, we are going to have the test perform        '   an IN which will allow us to perform a query that includes all of the values in the myFruit        '   array.  my_Fruit is the field in the database.  So this where clause would look like this        '   in T-SQL  "SELECT ... WHERE my_Fruit IN (0,1,2) ..."        where = New WhereStatement(New String() {"my_Fruit"}, myFruit, WhereStatementTypeOptions.In)        '-- Add the where statement to the collection        e.RawWhereStatementsCollection.Add(where)End Sub
By Ivan George Borges - 9/12/2012

Glad it worked! Cool