Hey All, I've narrowed down which revision started causing this problem. Beginning with revision 4698, selecting an item for the second time in a dropdown causes the program to freeze. I've left my posted code below... hopefully it doesn't get snipped by the server.
Please, if you have any ideas on how I can fix this, let me know. Thanks, Mike M. On Tue, Dec 16, 2008 at 12:25 PM, Mike Mabey <[email protected]> wrote: > On Mon, Dec 15, 2008 at 5:12 PM, Ed Leafe <[email protected]> wrote: > >> On Dec 15, 2008, at 4:52 PM, Mike Mabey wrote: >> >> > def onHit(self, evt): >> > frm = self.Form >> > frm.PrimaryBizobj.moveToPK(frm.NameDropDown.Value) >> >> Is this dropdown set to ValueMode="Key", with the Keys property >> populated with the PKs of the table for that bizobj? >> > > Yes, the ValueMode is set to "Key". I populate the Keys property > dynamically because of the two dropdowns that filter the available names. > Here's the code for the name dropdown: > > def afterInit(self): > biz = self.Form.getBizobj("grad_students") > names, pks = biz.getNames() > self.Choices = names > self.Keys = pks > self.ValueMode = "Key" > > def update(self): > sem = "" > if self.Form.SemDropDown.Value is not None: > sem = "`applying_semester` = '"+self.Form.SemDropDown.Value+"' AND > " > year = "" > if self.Form.YearDropDown.Value is not None: > year = "`applying_year` = '"+self.Form.YearDropDown.Value+"' AND " > where = "WHERE "+sem+year+"1 " > biz = self.Form.getBizobj("grad_students") > names, pks = biz.getNames(where) > self.Choices = names > self.Keys = pks > self.ValueMode = "Key" > > > SemDropDown and YearDropDown are the two other dropdowns that filter the > names. Here is the code for the "Filter" button: > > def onHit(self, evt): > frm = self.Form > frm.NameDropDown.update() > biz = frm.PrimaryBizobj > sem = frm.SemDropDown.Value > year = frm.YearDropDown.Value > biz.setWhereClause("") > if (sem is not None): > biz.addWhere("`applying_semester` = '%s'" % sem) > if (year is not None): > biz.addWhere("`applying_year` = '%s'" % year) > frm.requery() > frm.refresh() > > Am I doing something wrong here? > > > >> >> > frm.requery() >> > >> > I've been able to verify that when a name is selected, the "Go To" >> > button is >> > clicked, and the name dropdown is opened again, the program totally >> > freezes >> > and my CPU usage shoots up to 100%. What could possibly be causing >> > it to do >> > this? >> >> Besides the suggestion Paul made, I wonder how you populated the >> dropdown list. Is it bound to the bizobj in question? >> > > Yes, I only have one bizobj for the app. Should I separate the two? I > currently have it set up so that the names that are available in the > dropdown are the same ones accessed when the "First", "Prior", "Next", and > "Last" buttons are clicked. I can change this without loosing much > funtionality. I'm not sure how much those buttons are used by my client > anyway. > > Thanks for the help, > Mike M. > > --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ 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]
