StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


1234»»»

Browse Dialog Search Field Combo-EnumExpand / Collapse
Author
Message
Posted 07/25/2007 3:06:09 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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

Post #10563
Posted 07/25/2007 3:32:05 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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.
Post #10564
Posted 07/25/2007 4:13:27 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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

  Post Attachments 
WindowsApplication2.zip (3 views, 75.49 KB)
Post #10565
Posted 07/26/2007 9:27:15 AM


StrataFrame Developer

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
Post #10575
Posted 07/26/2007 1:57:08 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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.

Command #: 1
Timestamp: 2007-07-26 14:34:51.933
General Command Settings
Command Type: Text
Object Type: System.Data.SqlClient.SqlCommand
Connection String: Data Source=ares;Initial Catalog=StrataFrameSample;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True
Transaction: False
Command Settings
CommandText: 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
@PARAM0: '1' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: | SourceVersion: Current]
Command #: 2
Timestamp: 2007-07-26 14:35:02.292
General Command Settings
Command Type: Text
Object Type: System.Data.SqlClient.SqlCommand
Connection String: Data Source=ares;Initial Catalog=StrataFrameSample;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True
Transaction: False
Command Settings
CommandText: 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
@PARAM0: '2%' [DbType: String | Size: 60 | Direction: Input | SourceColumn: | SourceVersion: Current]

Post #10580
Posted 07/26/2007 2:51:58 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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

Post #10582
Posted 07/27/2007 8:45:05 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:09:33 AM
Posts: 2,661, Visits: 1,876
What did you change to make it work?


www.bungie.net
Post #10591
Posted 07/27/2007 8:59:01 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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 visible

If Not loItem.Visible Then

Continue For

End 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 contents

For lnCnt = 0 To _Controls.Count - 1

'-- Get a reference to the control

loControl = _Controls(lnCnt)

'-- If the control has data, then add the control to the list of where statements

If HasData(loControl) Then

'-- Add the where statement-- Paul Change to look at new collection

'loReturn.Add(BuildWhereElement(lnCnt))

loReturn.Add(BuildWhereElement(_VisibleSearchFields(lnCnt)))

End If

Next

 

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

Post #10597