Ok, so that worked and I now have my bizobject.  It is working without
problems.  The next issue that I am having is how to bind the grid
datasource/field to the bizobject.  Do I just bind the grid datasource
to the bizobj reference and ignore the field and set the fields on the
columns?  This is what I have so far, but it appears to go into an
infinite loop...

                self.custGrid = dabo.ui.dGrid(self, DataSource=self.custBizobj,
AlternateRowColoring=True, SelectionMode="Row", Editable=False,
MovableColumns=True)

                self.custGrid.addColumn(self, Name="Last Name",
DataField="LastName", DataType="string", Width=40, Caption="Customer
Last Name", Sortable=True, Searchable=True, Editable=True,
Expand=False)
                
                self.custGrid.addColumn(self, Name="First Name",
DataField="FirstName", DataType="string", Width=40, Caption="Customer
First Name", Sortable=True, Searchable=True, Editable=True,
Expand=False)
                
                self.custGrid.addColumn(self, Name="Address", 
DataField="Address",
DataType="string",Caption="Customer Address", Sortable=True,
Searchable=True, Editable=True, Expand=True)

Also, do I need to add columns for every field on the bizobj?

Cheers,

Nate L.

On Jan 7, 2008 10:28 AM, Paul McNett <[EMAIL PROTECTED]> wrote:
>
> Nate Lowrie wrote:
>
> > I am using a grid to display a list of customers, the customer info
> > includes first name, last name, address, City, State, and Zipcode.
> > The city and state fields are located in a zipcode table which uses
> > the zipcode (int) as a primary key.  The rest of the info is in the
> > customer table, including a zipcode as a foreign key.  I want to
> > display the customer list in a grid and limit the results to 50 shown.
> >
> > How do I get 2 bizobjects to function as the datasource for the grid?
> > I am a little lost here as this is the first time I am using the grid
> > for anything and I am still shaky with BizObjects.  The dGrid_test
> > does not use bizobjects and sets the dataset, so it is limited in use
> > to me.  An example would be of great.  Thanks.
>
> Don't use 2 bizobjs, just join the tables in your sql. IOW:
>
> biz.UserSQL = """
>   select customers.first_name,
>          customers.last_name,
>          customers.address,
>          zipcodes.city,
>          zipcodes.state,
>          customers.zipcode
>     from customers
>    inner join zipcodes
>       on zipcodes.zipcode = customers.zipcode
>    order by customers.zipcode, zipcodes.state, zipcodes.city
>    limit 50
> """
>
> In your real code, you'll want to use the sqlbuilder functions such as
> addField(), addJoin(), addWhere(), etc. but I wanted it to be clear what
> we are doing here. You can't set UserSQL and then add a where clause so
> UserSQL is of limited usefulness unless you add more code yourself.
>
> Then if the user changes the value of the zipcode field, you'll either
> want to requery the dataset or just fetch the new city, state from the
> zipcode table for that record.
>
>
>
>
> Paul
>
> --
> http://paulmcnett.com
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to