Author: johannes
Date: 2007-11-07 08:41:55 -0600 (Wed, 07 Nov 2007)
New Revision: 282
Modified:
address/forms/address.gfd
Log:
Only perform queries if the search value has changed
Modified: address/forms/address.gfd
===================================================================
--- address/forms/address.gfd 2007-11-06 09:10:51 UTC (rev 281)
+++ address/forms/address.gfd 2007-11-07 14:41:55 UTC (rev 282)
@@ -418,6 +418,7 @@
<dialog name="dlg_search_company" title="Suche nach Firma">
<parameter name="prm_result" datatype="number" length="8" scale="0"/>
+ <parameter name="prm_search" datatype="text" length="100" />
<trigger type="ON-ACTIVATION">act_initialize.run()</trigger>
@@ -473,6 +474,7 @@
blk.search.value = None
blk_company.clear()
setFocus(blk.search)
+ setParameter('prm_search', '')
</action>
<action name="act_filter">
@@ -508,11 +510,15 @@
return result
val = blk.search.value
+ old = getParameter('prm_search')
- if val is not None:
- blk_company.query(build_pattern("%%" + val + "%%"))
- else:
- blk_company.clear()
+ if old != val:
+ if val is not None:
+ blk_company.query(build_pattern("%%" + val + "%%"))
+ else:
+ blk_company.clear()
+
+ setParameter('prm_search', val)
</action>
<action name="act_button_focus">
@@ -539,6 +545,7 @@
<dialog name="dlg_search_contact" title="Suche nach Ansprechperson">
<parameter name="prm_company" datatype="number" length="8" scale="0"/>
<parameter name="prm_contact" datatype="number" length="8" scale="0"/>
+ <parameter name="prm_search" datatype="text" length="120" />
<trigger type="ON-ACTIVATION">act_initialize.run()</trigger>
@@ -597,6 +604,7 @@
blk.search.value = None
blk_contact.clear()
setFocus(blk.search)
+ setParameter('prm_search', None)
</action>
<action name="act_filter">
@@ -630,11 +638,14 @@
return result
val = blk.search.value
+ old = getParameter('prm_search')
+ if old != val:
+ if val is not None:
+ blk_contact.query(build_pattern("%%" + val + "%%"))
+ else:
+ blk_contact.clear()
- if val is not None:
- blk_contact.query(build_pattern("%%" + val + "%%"))
- else:
- blk_contact.clear()
+ setParameter('prm_search', val)
</action>
<action name="act_button_focus">
@@ -662,6 +673,7 @@
<dialog name="dlg_search_phone" title="Suche nach Telefonnummer">
<parameter name="prm_company" datatype="number" length="8" scale="0"/>
<parameter name="prm_contact" datatype="number" length="8" scale="0"/>
+ <parameter name="prm_search" datatype="text" length="120" />
<trigger type="ON-ACTIVATION">act_initialize.run()</trigger>
@@ -722,19 +734,23 @@
blk.search.value = None
blk_contact.clear()
setFocus(blk.search)
+ setParameter('prm_search', None)
</action>
<action name="act_filter">
val = blk.search.value
+ old = getParameter('prm_search')
+ if old != val:
+ if val is not None:
+ item = "%" + val + "%"
+ blk_contact.query(['or',
+ ['like', ['field', 'phone1x'], ['const', item]],
+ ['like', ['field', 'phone2x'], ['const', item]],
+ ['like', ['field', 'phonex'], ['const', item]]])
+ else:
+ blk_contact.clear()
- if val is not None:
- item = "%" + val + "%"
- blk_contact.query(['or',
- ['like', ['field', 'phone1x'], ['const', item]],
- ['like', ['field', 'phone2x'], ['const', item]],
- ['like', ['field', 'phonex'], ['const', item]]])
- else:
- blk_contact.clear()
+ setParameter('prm_search', val)
</action>
<action name="act_button_focus">
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.