Author: reinhard Date: 2009-10-28 10:26:15 -0500 (Wed, 28 Oct 2009) New Revision: 10018
Added: trunk/gnue-sample/forms/customer-search.gfd Log: Added new sample for an entry linked to a grid. Added: trunk/gnue-sample/forms/customer-search.gfd =================================================================== --- trunk/gnue-sample/forms/customer-search.gfd (rev 0) +++ trunk/gnue-sample/forms/customer-search.gfd 2009-10-28 15:26:15 UTC (rev 10018) @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + GNU Enterprise Sample Application - Customer search + + Copyright 2009 Free Software Foundation + + This file is part of GNU Enterprise + + GNU Enterprise is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3, or (at your option) any later version. + + GNU Enterprise is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with program; see the file COPYING. If not, + write to the Free Software Foundation, Inc., 59 Temple Place + - Suite 330, Boston, MA 02111-1307, USA. + --> + +<form title="Customer Search"> + <options> + <option name="author" value="GNU Enterprise Samples"/> + <option name="version" value="$Rev: 9959 $"/> + <option name="description" value="Search for a customer"/> + </options> + + <!-- ==================================================================== --> + <!-- Datasources --> + <!-- ==================================================================== --> + + <datasource name="dts_customer" connection="sample" table="customer" > + <sortorder> + <sortfield name="name" descending="False" ignorecase="True" /> + <sortfield name="city" descending="False" ignorecase="True" /> + </sortorder> + </datasource> + + <!-- #################################################################### --> + + <datasource name="dts_country" connection="sample" table="country" prequery="Y"> + <sortorder> + <sortfield name="code" descending="False" /> + </sortorder> + </datasource> + + <!-- ==================================================================== --> + <!-- Logic --> + <!-- ==================================================================== --> + + <logic> + <block name="blk"> + <field name="filter" datatype="text" length="32" case="upper"> + <trigger type="POST-CHANGE"> + act_filter.run() + </trigger> + </field> + </block> + + <block name="blk_customer" datasource="dts_customer" editable="N" deletable="N"> + <field name="name" field="name" datatype="text" length="50" /> + <field name="address1" field="address1" datatype="text" length="50" /> + <field name="address2" field="address2" datatype="text" length="50" /> + <field name="city" field="city" datatype="text" length="30" /> + </block> + </logic> + + <!-- ==================================================================== --> + <!-- Layout --> + <!-- ==================================================================== --> + + <layout tabbed="none"> + <page name="pg"> + <vbox> + <entry block="blk" field="filter" label="Search for:" grid_link="grd_customer"/> + + <grid name="grd_customer" block="blk_customer" rows="20"> + <gridline> + <entry field="name" label="Name" style="label"/> + <entry field="address1" label="Address-1" style="label"/> + <entry field="address2" label="Address-2" style="label"/> + <entry field="city" label="City" style="label"/> + </gridline> + </grid> + </vbox> + </page> + </layout> + + <!-- ==================================================================== --> + <!-- Actions --> + <!-- ==================================================================== --> + + <action name="act_filter"> + val = blk.filter.value + if val is not None: + val = "%%" + val + "%%" + blk_customer.set_filter(['or', + ['like', ['upper', ['field', 'name']], ['const', val]], + ['like', ['upper', ['field', 'address1' ]], ['const', val]], + ['like', ['upper', ['field', 'address2' ]], ['const', val]], + ['like', ['upper', ['field', 'city' ]], ['const', val]]]) + else: + blk_customer.clear() + </action> +</form> Property changes on: trunk/gnue-sample/forms/customer-search.gfd ___________________________________________________________________ Name: svn:keywords + Id _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue