Thanks for the reply.
It's good to know that it works for someone else, so I can react
accordingly.
> This is quite strange. You are sure that nowhere in the getClients() method
> of
> the Hours bizobj or in the afterInit() method of the dropdown list the fields
> from the Clients table ("clientname" and "pkid") have changed places by
> mistake? Because that would give exactly the error you described, I think.
>
Yes. I am as positive as I can be that I have that correct. The
dropdownlist does display the name not the key.
> def getClients(self):
> """Return a 2-tuple of lists of the client names and their
> keys."""
> crs = self.getTempCursor()
> crs.execute("select pkid, clientname from clients order by
> clientname")
> ds = crs.getDataSet()
> # Create the lists
> names = [rec["clientname"] for rec in ds]
> keys = [rec["pkid"] for rec in ds]
> return (names, keys)
> def afterInit(self):
> biz = self.Form.getBizobj("hours")
> names, pks = biz.getClients()
> self.Choices = pks
> self.Keys = names
> self.valueMode = "Key"
> print 'names',names
> print 'keys',pks
I decided to change the order around of setting the list as you can see
in AfterInit above and I get a Type error: string or unicode type required.
> You can set
> self.NonUpdateFields = ["clientname"]
> in BizHours.initProperties(), then it works. That was the answer I got to the
> same question (http://leafe.com/archives/showFullThd/395297#0).
Apolgies. I thought I had read the whole of the thread. Obviously not.
I'll make sure to be more thorough next time.
> Something else: the "summary" page of the Hours form only shows the newly
> entered records and doesn't show the client name. Adding
>
> def onPageEnter(self, evt):
> self.Form.requery()
>
> for this page helps.
Thanks for the tip. Much appreciated. That will save me running up against that
problem. I haven't bothered much with the final page, mainly because I have the
problem with saving records. So that final page is not too meaningful at the
moment.
> And now of course we'd like to know what controls should go to the bottom
> slot
> of the summary page and what they should do.
Yes. Waiting with bated breath. :-)
In the meantime I took a look at John Fabiani's tutorial. From looking
at that and some other posts, it seems that most people hand-crank the
gui rather than use the classdesigner.
Whoever is doing the classdesigner is doing a good job because I don't
think it is an easy job.
Hopefully, they will keep at it.
Regards and thanks for the response.
John Aherne
_______________________________________________
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]