By Paul Chase - 7/25/2007
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
|
By Paul Chase - 7/25/2007
I got it to work on a simple example so I'm not sure what is causing my issue.
|
By Paul Chase - 7/25/2007
It looks like the problem is with non visible search fields and the adjusted search fields collection. Here is a small sample app
|
By StrataFrame Team - 7/26/2007
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?
|
By Paul Chase - 7/26/2007
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] |
|
By Paul Chase - 7/26/2007
Ben,It looks like I have the code fixed on my end
|
By StrataFrame Team - 7/27/2007
What did you change to make it work?
|
By Paul Chase - 7/27/2007
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
|
By Paul Chase - 11/8/2007
Ben,I wanted to check and see if you ever had a chance to fix this? I overwrote the changes I made to the source a long time ago and had to scratch my head for awhile. Thanks Paul
|
By Paul Chase - 11/8/2007
What I posted above doesn't seem to work 100% it fixes the problem of non visible search fields but if you then make a search field visible it does not respect that you added made it visible, so it is like a 50 % fix
|
By Trent L. Taylor - 11/10/2007
Paul,I have had trouble reproducing this through the examples that you have provided. I made a number of changes to the BrowseDialog today and thought I would look as this as well. I did not make a change on this side as I could not make it fail. I will look at your sample again to see if I can make it fail from that point. But I may need some more information in order to address this. Thanks.
|
By Paul Chase - 11/12/2007
Trent,Maybe you fixed it since the last release? The problem is when you have nonvisible search fields. If you create 2 search fields one on the PK and another on some other field. Set the PK to nonvisible. fire up your app and show the browse, enter some data in your other search field, when you search the query that is built will be something like "select whatever from sometable WHERE PK_ID = my other search fields value". instead of "Where MyOtherSearchField = my other search fields value" The where clause is being built on the search fields collection regardless of visible or not Paul
|
By Trent L. Taylor - 11/13/2007
Download the latest fixes for the BrowseDialog and let me know if the problem persists. http://forum.strataframe.net/FindPost12630.aspx
|
By Paul Chase - 11/13/2007
Hi Trent,This is not fixed in that release. I created a sample app that reproduces the problem. Here are the steps I took 1) Created a BO and BrowseDialog mapped to your sample customer table 2.) create a search field on cust_pk with visible not checked 3.) create a search field on cust_firstname with visible checked 4.)create results showing pk and name When you call showdialog() only the cust_firstname field is visible for searching. If you try to search on all customers with a first name starting with "a" you will get a input string error however search on "25" and you will get whatever record's PK is 25. When the where clause is built it doesn't respect nonvisible fields. Let me know if the sample helps you see what I mean.
|
By Paul Chase - 11/15/2007
Hi Trent,Any word on this ? I had to revert back to the original source code that I modified because using the latest release still causes all of my browse dialogs to crash or display erroneous results as I posted before. (after reverting) the type editor for search fields no longer work's it simply does not appear. So it sucks to modify existing browse dialogs and to add a new one I ended up copy and paste all the code out of an existing one and modify the field names etc just to get it done.
|
By Ivan George Borges - 11/15/2007
Hi Paul.I tried your sample, was curious. I think this has to do with the change they might have made in order to get the RegistryKey working. Please, try in your end, put something in the BrowseDialog RegistryKey property (HKEY_LOCAL_MACHINE\SOFTWARE\Paul\test or whatever), run your sample and click the Search Fields in the toolstrip menu. Save it and test again. It works here. It is not a solution, but might get you going and gives a clue about where to look.
|
By Paul Chase - 11/15/2007
Ivan,Where you able to reproduce the problem prior to making the change you suggested ? I will test on my end but have to re-switch dll's
|
By Ivan George Borges - 11/15/2007
Yep, I was able to reproduce it.I had to get rid of the "PrimaryKeyIsRowGuid" BO property first, as I think this is something inheriting from a base BO of yours over there.
|
By Paul Chase - 11/15/2007
Ivan I'm just glad you could reproduce it.!!!! I thought I was going crazy. I'll tried what you suggested and it works, It looks like the search fields collection gets reordered so visible search fields are at the top when you save it. It is not really a solution but hopefully will help trent and ben get it fixed Trent, I'm sure you guy's have lots of fish in the fryer but anything you could do to get this resolved would be great I am planning on releasing a beta at our annual manager's meeting on Dec. 1st
|
By StrataFrame Team - 11/19/2007
Have you tried the latest DLLs that Trent posted in his last update? I believe he made several changes to the BrowseDialog to fix this as well as the issues when you use the same search field twice (and I believe the SelectedValue = -1 issue too). I'm pretty sure that he posted the update, so you might give it a try.He posted it in the updates forum from the main page.
|
By Paul Chase - 11/19/2007
Ben,It is still an issue with the latest update, also because I have modified the business layer (primary key is updatable) I am having to use my modified business.dll but I don't think that should make a difference. However that may be the reason why the type editors for the seach fields no longer works? It would be great if you guys could take a look at this. P
|
By Trent L. Taylor - 11/20/2007
Paul,I will take a look at this over the weekend. I got sick and was out of the office right after you had posted this sample and I never got around to looking at it. I will look at it this weekend over Thanksgiving sometime. Thanks.
|
By Paul Chase - 11/21/2007
Thank you Trent,I hope you are feeling better getting sick really sucks! I'd appreciate whatever you can do but don't kill yourself over it or work over the holiday. I am going to be doing a presentation and releasing a demo-beta version at the end of next week during our annual manager's meeting so if you can get something sometime next week that would be great if not the hack job I did works well enough that I should be able to release it ok. Paul
|
By Trent L. Taylor - 11/21/2007
Sounds good, Paul. Have a Happy Thanksgiving!
|
By Paul Chase - 11/28/2007
Trent,I am having an issue with one of my browse dialogs that is really screwing me up. After I tried the new Dll's that you posted and then reverted I have had issues with a few things, I have been able to work through most all of them but one browse dialog keeps failing and I can't figure out why, Of course it is the browse dialog for the central most important form in the application. (Why is it always like this?) . Anyways I'm under the gun so any help you can give me would be mucho appreciated. Also since flip flopping dll's the search fields editor does not work. Anyways here is the stack trace, Thanks Paul ArgumentOutOfRangeException Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Source : mscorlib Stack Trace: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.PositionLabels(Control& ParentControl) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.AddSearchFields() at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow..ctor(BrowseDialog BrowseDialogSettings, Boolean PopulateOnShow) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow, IWin32Window ResultsWindowOwner) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog() at ActionLabor.Payroll.UI.WindowsForms.Frmmain.BtnBrowse_ItemClick(Object sender, ItemClickEventArgs e) in C:\Action Labor Payroll\UI\Forms\FrmMain.vb:line 549 at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link) at DevExpress.XtraBars.BarBaseButtonItem.OnClick(BarItemLink link) at DevExpress.XtraBars.BarItemLink.OnLinkClick() at DevExpress.XtraBars.BarItemLink.OnLinkAction(BarLinkAction action, Object actionArgs) at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs) at DevExpress.XtraBars.BarItemLink.OnLinkActionCore(BarLinkAction action, Object actionArgs) at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.ClickLink(BarItemLink link) at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link) at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at DevExpress.XtraBars.Controls.DockedBarControl.WndProc(Message& msg) at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
By Paul Chase - 11/28/2007
Trent,I found the issue above. I had added a registry key to test Ivans theory and saved it with no search fields, I completly forgot about adding it, anyways that was all it was
|
By Trent L. Taylor - 11/28/2007
Ah...yeah, that would get you Glad you found it. As for the sample that you sent, I have not yet worked through it....but it is on my to-do list and I will get it taken care of before the next update.
|
By Paul Chase - 11/28/2007
Yeah it was driving me crazy, it never fails the entire company is coming in for our annual meeting and the most important screen in the application decides to go on vacation.
|
By Trent L. Taylor - 11/28/2007
LOL....I know EXACTLY how that goes
|
By Ivan George Borges - 11/28/2007
I found the issue above. I had added a registry key to test Ivans theory... oops, I did it again.
|
By Trent L. Taylor - 2/6/2008
OK, Paul, it was a simple bug. Try this UI assembly instead. I am assuming that you are already running on the 1.6.5 beta, so just add this assembly to you GAC and the c:\program Files\Common Files\MicroFOur\StrataFrame folder and you should be good to go. I did reproduce the error and once I made this change the BrowseDialog worked as it should in this scenario.
|