StrataFrame Forum

Browse dialog leaves a filter on my BO

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

By thegwill - 7/1/2007

I have a data maintenance form and I'm using the Browse dialog to offer a search.

I have a problem with the state that the Browse functionality leaves the maintenance form in after a browse is performed and the user selects one of the results. After closing the browse dialog I cannot navigate the full recordset that was previously populated in the business object bound to the Browse. Instead, only the search results that matched the user's search in the Browse dialog are available.

Is this by design? - if so, how do I clear the "filter" - should I Fill the data?

By Ivan George Borges - 7/1/2007

Hi Thegwill.

I think the Browse Dialog will search your table, and not your current recordset. What if the user chooses a record that wasn't in you recordset in the first place? Unless, of course, you are loading all records into your BO on form load.

If the user wants to have the whole recordset back, he/she could go back to Browse and do a search with no criteria. That would fill the BO with all records from the table.

By Trent L. Taylor - 7/2/2007

Is this by design? - if so, how do I clear the "filter" - should I Fill the data?

Yes.  The BrowseDialog will always search the data stores records and not the records within your BO.  The business object that you associate with the browse dialog on the form (BusinessObjectToPopulate) will have all of the interal records replaced with the results from the browse.  If you want to combine a BO on your form with the results that come back from the sever, then just drop another BO on your form which will be used for browse purposes only and leave the other BO which is bound to your controls alone.  Then once the browse has been performed, you can merge the two BOs by calling the CopyDataFrom method on the bound BO.

MyBoundBO.CopyDataFrom(MyBrowseBO, ClearAndFillFromTable)

If you want to search within a BO, then you can just perform a Select() on the DataTable itself:

MyBoundBO.CurrentDataTable.Select("WHERE STATEMENT")

Also, if you have an actual "Filter" applied, then just reset the property:

MyBO.FIlter = ""

Note: The BrowseDialog does NOT apply a filter, it pulls actual records back from the server.

By thegwill - 7/7/2007

Thanks for the suggestions. I'll give them a try