Ok. I followed your approach, and it works well.

I have one problem... When I change the datasource with a value (string,
int or float), it gets updated in my grid right away. If I change it
with a dropdownlist that is linking another bizobj (lookup table) it
doesn't get updated until I save the bizobj.

-Simen

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ed Leafe
Sent: 26. juli 2006 16:05
To: Dabo Users list
Subject: Re: [dabo-users] Dabo removes fully qualified field names.

On Jul 25, 2006, at 9:35 AM, Simen Haugen wrote:

> I think I don't have grasped the bizobj's, no...
>
> I have used bizobjs as a query, not a wrapper for a table.

        You can change the query that returns the data for a bizobj to
meet  
the needs of a particular form, but the main purpose of a bizobj is  
to represent the business rules of a given table. For example, a  
database table for Customer has no problem with the 'lastname' field  
being empty, but your business may require that valid customers  
include their names, so you create that rule in the customer bizobj,  
and this prevents bad/invalid data from being saved to the underlying  
table.

> I tried to link several bizobj's together to show them in a grid, but
> failed.
>
> Say I have.
> tblparent
> =========
> id
> childid
>
> tblchild
> ========
> childid
> name

        This is a standard lookup design, where the table you've called

'tblchild' is the lookup table.

> and I want to have a grid that shows tblparent.id and tblchild.name.
> I have created one bizobj for this.

        That's fine.

> Should I create two bizobjs for this? How then can I show this in a  
> grid
> that only takes one bizobj?

        You can certainly do this with a single bizobj, but what's more

likely is that you will need a bizobj for the lookup table as well if  
you want to change the value that the parent record points to.

        Let's take a more concrete example: the parent table is
'customer',  
and the child is 'phoneType', which has records like 'home', 'work',  
'mobile', 'fax', etc. Your customer record has a single phone field,  
and a link to the corresponding phone type.

        Now when you display your customer information in the grid, you
want  
to show the phone number and the description of the phone type. No  
problem; just create your bizobj's SQL to join to the phoneType table  
and return the description. But what if you want to allow the user to  
change the phoneType? You'd probably want to present them with a list  
of available phone types, from which they pick the correct one. But  
how do you get this list?

        That's where you need the bizobj for phoneTypes. You'd create a

method that would query the phoneTypes table and return the PK and  
description of each type. The form would use that to populate the  
list. The exact steps to do all this is documented on the wiki:
<http://dabodev.com/wiki/HowToPopulateAndUseListControls>

        I hope that this gets you started. Please post questions about  
anything that is still unclear, and I'll do my best to clarify.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to