> You can also look at the code for the Search page of any
> AppWizard-generated app to see how it generates the WHERE clause from the
> user's selections.
>
>
> -- Ed Leafe
>
The way I have my search set up is with one drop down list to select the
field you want to search, a second dropdown for the operator (equals, like
etc)
a text box to enter serch keywords and of course the button to click to
search with the above criteria. From my noob understanding of python your
example above is a separate search. I want to integrate it into my current
search setup.
def search(self):
txt = self.searchText.Value
if not txt:
self.searchText.setFocus()
return
fld = {"Project Name": "projectname", "Builder":
"buildername"}[self.searchFld.StringValue]
opstring = self.searchOp.StringValue
if opstring == "Equals":
op = "="
else:
op = "like"
if opstring.startswith("Starts"):
txt = "%s%%" % txt
elif opstring.startswith("Ends"):
txt = "%%%s" % txt
else:
# Contains
txt = "%%%s%%" % txt
biz = self.PrimaryBizobj
whr = "%s %s %%s" % (fld, op)
biz.setWhereClause(whr)
biz.setParams((txt,))
self.requery()
cnt = biz.RowCount
if not cnt:
dabo.ui.info("No matches found for '%s'." % txt, "Nothing matched")
else:
biz.RowNumber = 0
self.update()
Carey
--- 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]