On Apr 3, 2007, at 6:41 PM, bd wrote:

> def onValueChanged(self, evt):
>       print "value changed"
>       print self.Value
>       frm=self.Application.ActiveForm
>       grd=frm.gridts
>       biz=frm.getBizobj(grd.DataSource)
>       biz.setWhereClause("dat='%s'"%self.Value)
>       grd.fillGrid()
>
> I think I have correctly set up the regid for the grid, and I have the
> creatBizobj call in the forms afterinitall eventcode.
> I cannot get the grid filled with the data. If I get the bizobj in
> runtime, and I run the generated sql(CurrentSql) in sqlite, then I get
> several rows.
>
> What should I try get it working?

        You're close, but you didn't call the requery() for the bizobj to  
get the data. Try this:

def onValueChanged(self, evt):
        print "value changed"
        print self.Value
        frm=self.Form
        grd=frm.gridts
        biz=frm.getBizobj(grd.DataSource)
        # Note: when you use a parameter like this, you should
        # call setWhere() in the bizobj definition. You don't need
        # to re-set it every time.
        biz.setWhereClause("dat='%s'")
        # Set the current value for the query
        biz.setParams(self.Value)
        biz.requery()
        grd.fillGrid()

        This should work for you. I should add that in general, you should  
just have the date textbox call a form method, and the bulk of that  
logic should be in that method. But this will work, too; it's just  
not as clean a design.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.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