On Aug 19, 2009, at 8:33 AM, [email protected] wrote:
> 1) Can you point us to the place in the appwizard-generated code
> where the
> work of the requery takes place(building the clause and executing
> the sql)?
> I know it's probably right in front of me, but I can't see it!
It's actually deep in the database layer. Setting all the components
of the query using the methods such as addField, addWhere, etc.,
establish the parts of the query. When requery() is called, those
parts are assembled into the actual query.
> 2)How do you shift focus from one page on a pageframe to another?
> (Using
> the setFocus on a grid on the other page doesn't seem to be working.)
Use either:
dPageFrame.SelectedPage = myPage
or
dPageFrame.SelectedPageNumber = 2
> 3) Our attempt to get this to work is below (bypassing the
> construction of
> the where clause, we're just changing the query to something that
> should
> get a subset).
>
> bizRuns = self.Form.getBizobj("runs")
> bizRuns.addWhere("run_tech = 'RUBIN'")
>
> dabo.ui.info(bizRuns.getSQL(),title="SQL")
> bizRuns.setSQL()
> self.Form.requery()
>
> The getSQL returns the query with the new where clause, but the
> requery
> gets the original dataset, ignoring the new where clause.
Ah, I think you're mixing the two ways of creating SQL.
Dabo provides SQL Builder capabilities: you define the fields,
tables, joins, conditions, groupings, etc., using the SQL builder
methods. When you call requery(), Dabo will construct an SQL statement
on the fly using the syntax of your current backend database.
However, you're not required to use these methods. You can directly
set the SQL you want to run to get your data; if you do that, all of
your SQL Builder calls and settings are ignored, and your explicit SQL
is used.
setSQL() is a deprecated call that sets the UserSQL property of the
bizobj (you should just set UserSQL directly). If the UserSQL is not
empty, it is used directly; you can call addWhere() all day long and
nothing different will happen.
Try removing the calls to setSQL(), and any direct setting of the SQL
(also deprecated) or UserSQL properties. Then the bizobj should use
the SQL Builder calls instead.
-- Ed Leafe
_______________________________________________
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/[email protected]