Kwa Kil On Swa

Thursday, November 09, 2006

appfuse appgen tips creating a seach by criteria screen

create search fields screen using appgen on a dummy table and use the generated "add" functionality to capture the fields.

0. Hot tip for using appgen - go into middlegen first and do an "ant clean" otherwise your pojos will get overwritten.

1. appgen needs a primmary key to generate properly which is why dummy_id is defined in the table create below

2. appgen does not like postgres domains (user defined types) and will not generate some of the files properly if there is a single column with a domain type.

3. Unless you have at least one NOT NULL column in your table, then the MyTable-validation.xml is not a legal webwork validation file.

4. If using appgen on a postgres table with "boolean" columns, the generate MyTable class needs to have all occurrences of "Boolean" replaced by "boolean". Otherwise you get a very confusing error when webwork validates: The content of element type "validators" is incomplete, it must match (field|validator)+"



drop table stock_maintenance_query_criteria;

select
p.part_id as dummy_id,
f.fleet_id, vt.type_id, v.vessel_id,
ec.class_cd, e.equipment_nm,
p.part_nm,
c.company_id as maker_company_id, p.maker_ref,
c.company_id as supplier_company_id, sp.supplier_ref,
l.zone_id, l.location_id, true as stock_alert,
p.drawing_ref
into stock_maintenance_query_criteria
from
fleets f,
vessels_types vt,
vessels v,
vessels_in_fleets vf,
equipments_classes ec,
equipments e,
companies c,
parts p,
suppliers_for_parts sp,
locations l
where 1=1
and f.fleet_id = -1
and vt.type_id = -1
and v.vessel_id = -1
and vf.vessel_id = -1
and ec.class_cd = -1
and e.equipment_id = -1
and c.company_id = -1
and p.part_id = -1
and sp.part_id = -1
and l.location_id = -1;

alter table stock_maintenance_query_criteria add CONSTRAINT pk PRIMARY KEY (dummy_id);

0 Comments:

Post a Comment

<< Home