| | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:55:17 PM Posts: 336, Visits: 2,078 |
| | I am trying to use The Combo-Enum option for a browse dialog search field. The combo is populated properly from the Enum. If the Combo is left alone at <Not Selected and a search is executed I get a good result set however if a value is selected from the drop down and another search is executed nothing is returned.
p |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:55:17 PM Posts: 336, Visits: 2,078 |
| | I got it to work on a simple example so I'm not sure what is causing my issue. |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:55:17 PM Posts: 336, Visits: 2,078 |
| It looks like the problem is with non visible search fields and the adjusted search fields collection. Here is a small sample app
|
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 9:09:33 AM Posts: 2,661, Visits: 1,876 |
| While I'm looking at this sample, can you take a look at the debug file for the data source? Does the command executed by the BrowseDialog look remotely correct? Or is it adding/removing fields?
www.bungie.net |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:55:17 PM Posts: 336, Visits: 2,078 |
| | Ben, I was out of the office all morning at a branch location.... The problem is that when you are building the where clause you are looping through the controls and passing the control's counter position to the BuildWhereElement function whch then looks at the adjusted fields collection. However the count does not nessasarily reflect the search fields proper position in the adjusted fields collection if there are non visible fields. As you can see the on second Select Statement the where clause is built with the wrong field. Hope that makes sense. | 1 | | 2007-07-26 14:34:51.933 | | General Command Settings | | Text | | System.Data.SqlClient.SqlCommand | | Data Source=ares;Initial Catalog=StrataFrameSample;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True | | False | | Command Settings | | SELECT TOP 1000 [cust_pk], [cust_Company], [cust_Prefix], [cust_FirstName], [cust_MiddleName], [cust_LastName], [cust_Suffix], [cust_Address1], [cust_Address2], [cust_City], [cust_State], [cust_Postal], [cust_Country], [cust_Email], [cust_PhoneDay], [cust_PhoneDayType], [cust_PhoneNight], [cust_PhoneNightType], [cust_Created], [cust_Version] FROM [dbo].[Customers] WHERE [cust_PhoneDayType] = @PARAM0; | | Command Parameters | | '1' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: | SourceVersion: Current] |
| 2 | | 2007-07-26 14:35:02.292 | | General Command Settings | | Text | | System.Data.SqlClient.SqlCommand | | Data Source=ares;Initial Catalog=StrataFrameSample;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True | | False | | Command Settings | | SELECT TOP 1000 [cust_pk], [cust_Company], [cust_Prefix], [cust_FirstName], [cust_MiddleName], [cust_LastName], [cust_Suffix], [cust_Address1], [cust_Address2], [cust_City], [cust_State], [cust_Postal], [cust_Country], [cust_Email], [cust_PhoneDay], [cust_PhoneDayType], [cust_PhoneNight], [cust_PhoneNightType], [cust_Created], [cust_Version] FROM [dbo].[Customers] WHERE [cust_LastName] LIKE @PARAM0; | | Command Parameters | | '2%' [DbType: String | Size: 60 | Direction: Input | SourceColumn: | SourceVersion: Current] |
|
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:55:17 PM Posts: 336, Visits: 2,078 |
| | Ben, It looks like I have the code fixed on my end |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 9:09:33 AM Posts: 2,661, Visits: 1,876 |
| | | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:55:17 PM Posts: 336, Visits: 2,078 |
| | Ben, I just added another search fields collection to store the visible controls. '--New Paul Code Add new private var search field Collection Private _VisibleSearchFields As New SearchFieldCollection() In the CreateAllSearchFieldControls() sub I add the search field item to the above collection. '-- See if the control is visibleIf Not loItem.Visible ThenContinue ForEnd If'--Start New Paul Code Add to Visble Collection_VisibleSearchFields.Add(loItem) '--End New Paul Code Add to Visble Collection Finally in the BuildWhereSearchClause '-- Cycle through all of the fields to determine which fields' have contentsFor lnCnt = 0 To _Controls.Count - 1'-- Get a reference to the controlloControl = _Controls(lnCnt) '-- If the control has data, then add the control to the list of where statementsIf HasData(loControl) Then'-- Add the where statement-- Paul Change to look at new collection'loReturn.Add(BuildWhereElement(lnCnt)) loReturn.Add(BuildWhereElement(_VisibleSearchFields(lnCnt))) End IfNext There is still an issue with re-adding non visible search fields via the search fields list box. I would need to rebuild the visible controls collection there but just haven't looked at it yet P |
| | | | |
|