Searching not working on BrowseDialog


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Wow...thanks for all of the comments guys.  I am glad that it helped!!!  We have a saying down here in Texas, "Even a blind hog finds an acorn now and then." BigGrin (For those needing the Texas translation, that would make me the blind hog Hehe ...and the way I have been eating lately....well...you know where this is going).
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Edhy! sh sh sh sh... I'm hiding. Tongue
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Wow, thanks Trent. That mostly makes sense. I'll chew on it and let is stew for a bit.



BTW, I was favoring the gypsy curse theory originally, but decided to post a question first. I'm glad I did as I avoided the whole "chanting a Romanian counter curse while walking backwards during a full moon covered in a chocolate marshmallow sauce" thing Charles was suggesting... Alien
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Trent for President!!!

or maybe a MVP nomination?

http://www.microsoft.com/india/mvp/nominations.aspx

Keith Chisarik

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I bumped this to Trent not because I thought it was bug but because he's just the guy who probably actually understands this stuff.



( I had been suggesting to Greg I thought it was caused by sun-spots or maybe a gypsy curse )



Even stranger - Trent can explain it so the slow kids in the class (me) can understand it Tongue



Thanks Trent !



Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Well, all blaming joke aside, this is an excellent lecture.  I am printing this one and adding it to my SF training book.

Thanks Trent!

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
It has to do with the MDI client and the instantiation order.  The issue has to do with threading, basically.  The form had not fully instantiated itself into the MDI client.  The handle had been created, the MDI parent form had been set, but the searching uses two elements that rely on threading: WaitWindow and the DataLayer.  Now at this point, the DataLayer should not be a factor, but the WaitWindow could as well as the BD component.  Here is the heirarchy of a browse dialog without any parent:

BrowseDialog (Component) -> BrowseDialog Form

Now when you drop a BD on a form the hierarchy looks like this:

Form -> BrowseDialog (Component) -> BrowseDialog Form

Now when you click the searching button, it would look like this:

Form -> BrowseDialog (Component) -> BrowseDialog Form -> Search (Button Click) -> WaitWindow (Component) -> WaitWindow (Thread) -> WaitWindowForm

Keep in mind that each handle or child relies on the parent as well.  Since a form doesn't load on a thread, it is a procedural execution (as it should be).  So the form instantiates in a logical order, for example, OnHandleCreated -> OnLoad -> OnCreateControl -> OnShown, etc.  So now take your logic, which you had in the Load.  Well, at this point, the entire form had not actually completed instantiation and since one builds on top of the of the other using the line of events placed above, the Form in that example and in the code that you had, was still blocking in the Load.  When the other windows that rely on a fully instantiated form as well as certain elements (such as the handle and ParentForm properties), then you can get a lock since all code has not executed.  So in this example, I moved your code further down the execution chain which prevented the "blockage" and allowed the base object to complete instantiation.

So take the case when you click the cancel:

Form -> BrowseDialog (Component) -> BrowseDialog Form -> Cancel (Button Click)

Using this example, there were no downstream components that relied on the full instantiation of the parent object, thus no lock.

This is a super '"Reader's Digest"example, and this can get really complicated.  But in short, when you run into something like this, move your code furhter down the instantiation chain or remove the reliance on the parent altogether (which is not always an option).

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, that worked. BigGrin



I don't understand why, though. The browse dialog is shown, just the searching doesn't work. The Cancel button works BigGrin. So the form is getting instantiated and it is shown and at least one of the event handlers is working. So, what is missing in the Load event that is there during OnShown?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Oh, I blame Dustin all of the time....and I have no problem blaming Ivan whatsoever! BigGrin
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (12/19/2008)
Me too BigGrin ... or at the very least...when it is not my fault Tongue

Humm, we can always blame Dustin BigGrin (Hi Dustin!)

Ivan, don't worry, so far you are safe for this kind of blame Tongue

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search