Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
Download the latest fixes for the BrowseDialog and let me know if the problem persists. http://forum.strataframe.net/FindPost12630.aspx
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
Sounds good, Paul. Have a Happy Thanksgiving!
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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)
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
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.
|
|
|
Paul Chase
|
|
Group: Forum Members
Posts: 414,
Visits: 2.8K
|
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.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
LOL....I know EXACTLY how that goes
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
I found the issue above. I had added a registry key to test Ivans theory... oops, I did it again.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
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.
|
|
|