I am in the process or redesigning an application which uses collections.
I have done the following, but am a bit uncertain how to proceed.
1. I have created a view landings_collection_view based on the collection SPECIES_COLLECTION:
CREATE OR REPLACE VIEW landings_collection_view (
seq_id,
landing_seq,
species_itis,
grade_code,
market_code,
unit_measure,
disposition_code,
gear_code,
reported_quantity,
price,
dollars,
area_code_flag,
c014,
additional_measure_flag,
addnl_reported_quantity,
addnl_unit_quantity,
fins_flag,
finsattached,
finsnotattached,
finsunknown,
fins_code,
area_fished,
sub_area_fished,
local_area_code,
explanation,
nature_of_sale,
hms_area_code,
sale_price,
hms_flag )
AS
SELECT
seq_id,
c003 landing_seq,
c004 species_itis,
c005 grade_code,
c006 market_code,
c007 unit_measure,
c008 disposition_code,
c009 gear_code,
c010 reported_quantity,
c011 price,
c012 dollars,
c013 area_code_flag,
c014 ,
c017 additional_measure_flag,
c018 addnl_reported_quantity,
c019 addnl_unit_quantity,
c020 fins_flag,
c021 finsattached,
c022 finsnotattached,
c023 finsunknown,
c024 fins_code,
c025 area_fished,
c026 sub_area_fished,
c027 local_area_code,
c028 explanation,
c029 nature_of_sale,
c040 hms_area_code,
c041 sale_price,
c050 hms_flag
from apex_collections
where collection_name = 'SPECIES_COLLECTION'
/
The SPECIES_COLLECTION is populated based on a query.
I have an application page comprised of a tabular form region based on the above view, Landings_collection_view.
I would like to update the column DISPOSITION_CODE in the tabular form, but in doing so, other column values will change. I am wondering about an ON-CHANGE action...but not certain where to place the code. I have created a package called SAFIS_COLLECTIONS.update_disposition.
procedure update_disposition(v_seq in number,
v_disposition_code in varchar2)
is
begin
apex_collection.update_member_attribute (p_collection_name=> 'SPECIES_COLLECTION',
p_seq => v_seq,
p_attr_number => 8,
p_attr_value => v_disposition_code);
apex_debug.message('updated disposition');
end;
so, basically, when the disposition code on the tabular form changes...for any record, I want to update the underlying species collection. It needs to be done as the disposition changes, as other columns may then appear/not appear...a whole other can of worms. ;0
thanks.
Karen