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


«««123

Tutorial 14 (Configuring a Business Object...Expand / Collapse
Author
Message
Posted 05/01/2006 4:40:36 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
You wouldn't need to put any code there because the navigation buttons on the MaintenanceFormToolstrip call the Navigate() methods on the business object(s), so the Navigated event is already getting raised (which re-filters the children automatically). The reason you have handle events on the parent grid in your scenario is because of the flat list problem... the grid doesn't need to navigate records, so you have to Navigate the business object manually. With the maintenance form toolstrip, and the way the CustomerMaintenance form works, you have to call Navigate to move to another record.


www.bungie.net
Post #1036
Posted 05/02/2006 7:26:03 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Thanks Ben, I'll look into that. I posted two things in a row. Please look at post 1033.

http://forum.strataframe.net/FindPost1033.aspx
Post #1041
Posted 05/02/2006 8:25:05 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
The error you're getting when trying to insert the child record is because the Titles business object is configured with PrimaryKeyIsAutoIncremented = True, and the primary key can only be auto-incremented for numeric data types. Since the primary key is not an auto-incremented value, you'll need to set the PrimaryKeyIsAutoIncremented property to False and assign a valid PK value for the new child record before saving. Basically, the server cannot assign the PK value, you'll have to assign it on the client side.


www.bungie.net
Post #1044
Posted 05/02/2006 8:26:57 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
As for the child grid not being cleared when you select a record that has no child records, put a handler on the TitlesBO.FilterChanged event and within it, put a message box, or a Debug.WriteLine() call within it and print the TitlesBO.Filter value. Basically, I want to make sure the filter is being set whenever you select a record that doesn't have any child records.


www.bungie.net
Post #1045
Posted 05/02/2006 9:27:38 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
As for the child grid not being cleared when you select a record that has no child records, put a handler on the TitlesBO.FilterChanged event and within it, put a message box, or a Debug.WriteLine() call within it and print the TitlesBO.Filter value. Basically, I want to make sure the filter is being set whenever you select a record that doesn't have any child records.


I'll try that.

Another question. I have the Customer Maintenance form and I have a parent child relationship setup with the Orders table. There is a grid on the maintenance form that displays the customers orders. I have everything setup correctly (i think) and when i run the program there is no errors but the navigation buttons are disabled. The first customer doesnt have any related orders. I dont know if that has anything to do with it.
Post #1049
Posted 05/02/2006 9:38:15 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
Make sure that the IncludeInFormNavigateType property on the CustomerMaintenance form is set to PrimaryBusinessObject and make sure that CustomersBO1 is set as the PrimaryBusinessObject on the form. For some reason, it looks like your form thinks it's supposed to be navigating Orders instead of Customers.


www.bungie.net
Post #1050
Posted 05/02/2006 12:32:40 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
I've checked both those things and they were set properly. I turned the ChildAutofilter property off and ran the program and it worked fine. I was able to navigate the customer form and the all the orders filled the grid. When I set ChildAutoFilter to MatchCurrentRow I got the attaced error.

  Post Attachments 
Error.jpg (18 views, 35.87 KB)
Post #1053
Posted 05/02/2006 12:53:51 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
I believe that there is already code within the Navigate method on that form that's requerying the database for the orders. You can either requery like that form is doing, or you can fill the parent and child with all of the necessary records and then let the child filtering do its thing. But, if you try to use both methods, you're going to run into problems.


www.bungie.net
Post #1054
Posted 05/02/2006 1:03:34 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Sorry, I dont understand. I have the SQL statements in the business objects that will be used to fill them. Then in the form I call those Fill methods in each BO's ParentFormLoading Event. You're saying not to fill the BO's on load?

This thread seems like its taking on a life of its own.
Post #1055