Hi Everyone, I am not certain if I am phrasing this properly, so bear with me.
I have a tabular form based on a collection. There are a variety of items, textareas, select lovs, and radio groups in this tabular form. Some of the items have a set id which correspond to the collection field...so for example,
c010 has id='f10'+seq
c012 has id='f12'+seq
when any field is changed, a dynamic action is executed.
dynamic action: COLUMN CHANGE
event: CHANGE
selection type: JQUERY SELECTOR
jquery selector: input[name='f10'],input[name='f11'],input[name='f12'],.shark_info, .hms_info
true action1: set value, javascript expression, set P110_ID = this.triggeringElement.id AFFECTED ITEM P110_VALUE
true action2: execute pl/sql code
begin
null;
end;
page items to submit: P110_ID
true action3: set value, javascript expression, set P110_VALUE = this.triggeringElement.value AFFECTED ITEM P110_VALUE
true action4: set value: PL/SQL expression, set P110_SEQ = rtrim(substr(:P110_ID,5,4),'0') AFFECTED ITEM: P110_SEQ
true action5: execute pl/sql code
declare
v_attr number;
begin
v_attr := TO_NUMBER (SUBSTR (:P110_id, 2, 2));
apex_collection.update_member_attribute
(p_collection_name => 'SPECIES_COLLECTION',
p_seq => :P110_SEQ,
p_attr_number => v_attr,
p_attr_value => :P110_VALUE);
end;
page items to submit: P110_ID, P110_VALUE, P110_SEQ
true action6: refresh region
The value of v_attr is set to a substr of P110_ID....and p110_id is based on the ID of the item.
I have one item, a radio group called c024. It is not called as an apex_item because the radio group (for whatever reason) would not work. Therefore, in order for c024 to correspond to attribute 24, I must make certain that there are 23 editable items appearing before it...or at least that is the only way to get it to work.
I am wondering if there is a way to assign the ID='f24'+seq manually in much the same way that I assigned the CSS class=.SHARK_INFO to this item.
any clues appreciated.
thanks,
Karen
ps. the query for the tabular form is: (and really, anything without an alias could be removed, but is there to ensure that c024 = f24. ugh. Is there a better way?
SELECT
apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
seq_id,
seq_id display_seq_id,
c003,
c004,
c005,
c006,
apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
apex_item.select_list_from_LOV(8,c008,'DISPOSITIONS','onchange="getAllDisposition('||seq_id||')"','YES','0',' -- Select Favorite -- ','f08_'||seq_id,'') Disposition,
apex_item.select_list_from_LOV(9,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus('||seq_id||');"onchange="getAllGears('||seq_id||')"','YES','3333','-- Select Favorite --','f09_'||seq_id,'') Gear,
apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars,
decode(c013,'Y',apex_item.text(14, c014,30,null,'style="background-color:#FBEC5D;" onClick="onFocusAreaFished('||seq_id||');"','f14_'||seq_id,''),'N','N/A') Area_Fished,
c014,
c015,
c016,
c017 additional_measure_flag,
decode(c017,'Y',apex_item.text(18, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity('||seq_id||')"','f18_'||seq_id,''),'N','N/A') UNIT_QUANTITY,
decode(c017,'Y',apex_item.text(19,'CN',3,null,'readOnly=readOnly;','f19_'||seq_id,''),'N','N/A') UNIT_COUNT,
c024 fins_attached,
apex_item.textarea(28,c028,3,null,'class="hms_info"','f28_'||seq_id,'') Explanation,
decode(c024,'N',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','class="hms_info"''onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'U',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'Y','N/A') Nature_Of_Sale,
c030,
c031,
c032,
c033,
c034,
c035,
c036,
c037,
c038,
c039,
apex_item.select_list_from_LOV(40,c040,'HMS_AREA_CODE','style="background-color:#FBEC5D;" class="hms_info"
',null,null,null,'f40_'||seq_id,'') HMS_AREA_CODE,
c020,
apex_item.text(41,TO_NUMBER(c041),5,null, 'class="hms_info"','f41_'||seq_id,'') Sale_Price,
c042,
c043,
c044,
c050
from apex_collections
where collection_name = 'SPECIES_COLLECTION' order by seq_id