browseDialog


Author
Message
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
Nope, it sounds like you are on the right track. You can fill any search field on the BD and it will fetch all records from the view you gave it as the BO type. Once you give it an OK it will then populate the BO you set as the BO to Populate with the results of your search criteria. The BO to populate should be an instance of the BO dropped onto your form, and it should be the type of the BO Type you set the BrowseDialog to work with. When you Close the BD, and you have an event exposed for that, you can then work with the BO instance populated with the contents brought according to your search criteria. If the BO instance you populated is the form's PrimaryBusinessObject, you don't even need to do anything, as it will be already populated and positioned on the record you chose from the BD before you OKed it.
Ian Johnston
Ian Johnston
StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
OK so how do I populate the view BO?
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
You don't. If your ViewBO instance is set as the BrowseDialog's BusinessObjectToPopulate, it will be automaticaly populated by the BrowseDialog control as soon as it fetches the records based on your search criteria.
Ian Johnston
Ian Johnston
StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
In the samples database I deployed the following view:

SELECT     dbo.Customers.cust_pk, dbo.Customers.cust_FirstName, dbo.Customers.cust_LastName, dbo.Customers.cust_City, dbo.Orders.or_ponumber
FROM         dbo.Customers INNER JOIN
                      dbo.Orders ON dbo.Customers.cust_pk = dbo.Orders.or_cust_pk

named it Customer_po

in the Browse dialog example I aded a BO customer_poBO

Set up the BO to be populated from the server

Overrode primary key specification

put Cust_pk

rebuild all

rebuilt application

added BO to the form

changed the browsedialog to look at it and set the search field appropriately

Put the following code in the toolstip cliked

if (this.printToolStripButton.Pressed)

{

}

set a break point

ran the application

In the object viewer for each field in the BO it says This.(whichever field) threw an exception of type'MicroFour.StratFrame.Business.businessLayerException'

Can you duplicate this?

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
Please, post your sample and I will have a look.
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
And sorry, I meant zip your sample solution and attach it to a post so I can download it.
Ian Johnston
Ian Johnston
StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
What to post and where
Ian Johnston
Ian Johnston
StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
How do you attach to a post?
Ian Johnston
Ian Johnston
StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)StrataFrame User (151 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
Please see ttached
Attachments
BrowseDialogSample.zip (80 views, 960.00 KB)
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
OK, some considerations:

You mapped your view to Customer_poBO, which is fine, and the cust_pk is been returned, perfect.

Your Customer_poBO has a fill method selecting records from the Customers table, I guess it should be from your Customer_po view. Although you won't need to fill this BO to have it working with the BrowseDialog. The BrowseDialog will fill it with the results it gets depending on your search criteria.

Your form has the CustomersBO1 as the PrimaryBusinessObject and your controls are bound to this BO properties. This is just fine.

But then, your BrowseDialog has the Customer_poBO1 as the BusinessObjectToPopulate. This is not a problem, but once your BrowseDialog brings your search results, this is the BO that will be populated, and not your form's BO, CustomersBO1.

Still on your BrowseDialog, you haven't set the SearchFields, and this will definetely throw an error at run time. You need to set them:

Once you get this working, you will have your Customer_poBO1 populated as soon as you Close the BrowseDialog after having your search results listed and pressing OK. At this stage, you need to use the BrowseDialogClosed event as I have tried to show you earlier on this following post:

http://forum.strataframe.net/FindPost20493.aspx

Why that? Because your results will have the Customer's PKs that you want to show on your form, so you need to get all the PKs from your populated view and fill your form's primary BO with the records that match this list of PKs from your view.

There might be some concepts you could be missing on how the BrowseDialog works. If you haven't done so, the Tutorial on the Help files could help you get a general idea of it. It is under "Application Framework / Getting Started / Tutorials / Creating a WinForms App"

Hope it helps. Wink

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