StrataFrame Forum

BrowseDialog Question

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

By Greg McGuffey - 11/9/2006

How would I set a static search criterion for a Browse dialog? I.e. I need to always limit the records returned by "project" (yes the infamous project), which is determined at run time. E.g. I have a process form (storing info about processes) that needs to always limit the search to the current project plus whatever criterion the user provides (if any).



Can I enter runtime determined values in the initial value, like a .net variable?



Is the criterion used to filter the BO or fill the table? If it used to filter, then I suppose the FillBy method that I'm using would do the trick.



Thanks!
By Trent L. Taylor - 11/9/2006

I need to always limit the records returned by "project" (yes the infamous project), which is determined at run time.

Set the BrowseDialogs MaximumReturnedRecords property...by default it is 1000. 

Can I enter runtime determined values in the initial value, like a .net variable?

me.MyBrowseDialog.SearchFields.Item("MyField").InitialValue = "Whatever"

Is the criterion used to filter the BO or fill the table?

Fill...a filter would not be feasible if there were a lot of records.  We dynamically create queries to pull data back from the server. 

Just FYI...there is a ton of documentation on this control.  It was just updated before this last release also.

By Greg McGuffey - 11/9/2006

OK, so to set an immutable search criterion would be configured to search on a field, set to be not visible, and then set the initialvalue in code when the form loads, right?
By Trent L. Taylor - 11/9/2006

At the moment the search field does have to be visible...but you can hide the entire search fields panel.  If you look at the FormLayout property, you can hide the side and bottom panels.  If you put the SearchFields in the bottom panel, and the Results in the top panel...you can totally control the search and have it return whatever data you want...and the end-user cannot control the search criteria.
By Greg McGuffey - 11/9/2006

Bummer.



I need to have one criterion that is set by program, then allow others to be set by user. So, I need to be able to hide just one search field. Oh well, I was hoping that the BrowseDialog would be an easy way to add some searching, but that is not the case in most of the situations I'll be using it.
By Trent L. Taylor - 11/9/2006

Well....just so you know, this has been on the enhancement requests for a while.  This is not the first request for this type of behavior.
By Greg McGuffey - 11/9/2006

Any way to subclass this puppy and add some functionality, while still leveraging the query string builder, etc.?
By Trent L. Taylor - 11/9/2006

Well, you can subclass a BrowseDialog so that you can reuse it over and over again...but the code that you would need to get to is buried within the class...and is really not something that you would want to change. 
By Greg McGuffey - 11/9/2006

Okey dokey...I guess I'll have to roll my own.