Ok, now I want to pick apart your method to explain some slightly better 
ways to do things:

bd wrote:
> Hello!
> 
> I want to make a simple form in dabo class designer.
> I have a one table database with a dat field containing a datum.
> I have made a form with class designer which contains a grid and a
> datetext control.
> My code to the datetextcontrol is:
> def onValueChanged(self, evt):
>       print "value changed"
>       print self.Value

-- I assume you are getting the expected things printing, here.

>       frm=self.Application.ActiveForm

-- you can certainly get the form reference this way, but presumably
-- your datetextcontrol is on the form in question? If so, then
-- you can just do:
        frm = self.Form

>       grd=frm.gridts
>       biz=frm.getBizobj(grd.DataSource)
>       biz.setWhereClause("dat='%s'"%self.Value)
>       grd.fillGrid()

-- you should really put this code in the form, and call the form
-- method from your onValueChanged event handler. Eg:

(in datetextcontrol):
        def onValueChanged(self, evt):
                self.Form.requeryGrid(self.Value)

(in form):
        def requeryGrid(self, param):
                grd = self.gridts
                biz = self.getBizobj(grd.DataSource)
                biz.setWhereClause("dat = '%s'")
                biz.setParams((self.Value,))
                self.requery(grd.DataSource)

Actually, your bizobj should just set that where clause with the 
parameter substitution in place, and the requeryGrid() method should 
just do the setParams() call.

> I think I have correctly set up the regid for the grid, and I have the
> creatBizobj call in the forms afterinitall eventcode.

If you don't have the grid's RegID set correctly, you won't get a 
reference to the grid using grd = self.gridts.

Cheers!
Paul

-- 
pkm ~ http://paulmcnett.com


_______________________________________________
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