On 04/24/2013 04:37 AM, Sabarish Sridhar wrote:
Hi guys,

I have a UI chooser screen where the user can choose his preferences . I
also have a button which when pressed focuses on a new tab. I have multiple
tables in my database all of them relevant to the current discussion. What
I am trying to do is construct a query using the users preferences and
populate the grid  using data from multiple tables and select only 2-3
common columns. When the user has clicked on one of the rows more data(all
the columns from my database for that particular record will be displayed).

So what I did was use the Appwizard and generate all the bizobjects and add
them to biz directory and also make sure the init.py in the biz directory
had all this imported.I also added all the bizobjects to the '*createBizobjs()'
  *of the form.   I am kind of lost as to how to handle the GUI next. Do I
use add control from data environment. If so then how do I get multiple
tables added to the same grid(I am thinking this is not the right way to
proceed).  Do I create a grid sizer separately and try to populate that?
Whats the most efficient way of handling this situation?


Displaying data from different tables in a grid can be handle in at least three ways.
1. use a view
2. create and use a function
3. a special column or two

In most database engines views are not updatable (exception would be Postgres). But views allow joins etc.. and can use parameters.

To use a function just set the DataSet/DataSource value of the grid to the function. self.DataSource = self.getLetterHist. The function will have to return the correct dataset.

But either of the above will not allow simple updates.

So you will have to handle one of the events (maybe the "Hit") on the grid to move the pointer of the table correctly. See "moveToPK" or some thing like that. Also look at 'Selection'

Each column of the grid can use - DynamicCustomRenderers (or a DynamicCustomRenderClass). The property of the column and return values that are not part of the table. When you update the database - it can be set not to use the value in the update statement.

That said, are you sure you need to do this? If the data is related then how about displaying two grids (parent - child). Or just using the grid as a read only selection tool - displaying the data you want to edit in text controls.

Johnf


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

Reply via email to