Issue with APEX_ITEM.CHECKBOX in Manual Tabular Form report
Hi,
I have a simple manual tabular form report with query :
SELECT
APEX_ITEM.CHECKBOX(1,order_id) ,
APEX_ITEM.TEXT(3,Ord_number) ,
APEX_ITEM.TEXT(4,ord_flag)
from
tbl_order
and a process to update the value of Ord_number & ord_flag columns for the selected (Checked) rows.
FOR i in 1..apex_application.g_f01.count
loop
UPDATE
tbl_order
SET
Ord_number = apex_application.g_f03(i),
ord_flag = apex_application.g_f04(i)
WHERE
order_id = apex_application.g_f01(i);
END LOOP;
But the values getting updated wrongly , how can I ensure the exact values is retrieved in apex_application.g_f03(i) & apex_application.g_f04(i) ?
Regards.
Benz
I think the row selector is there if you create an tabular form. However, you can create it yourself following this example:
http://apex.oracle.com/pls/otn/f?p=31517:170
Basically,
apex_item.checkbox (30,
'#ROWNUM#',
'onclick="highlight_row(this,' || ROWNUM || ')"',
NULL,
'f30_' || LPAD (ROWNUM, 4, '0')
) delete_checkboxDenes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------
Similar Messages
-
Query for create manual tabular form using apex collection using item textfield with autocomplete
can we create a manual tabular form inside item textfield with autocomplete ?
how it is possible?
with Apex_item API used for this item.
i used this code for creat cascading select list
select seq_id,
APEX_ITEM.SELECT_LIST_FROM_QUERY(
p_idx => 1,
p_value => c001,
p_query => 'SELECT C001 D
, C002 R
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = ''col1''',
p_attributes => 'style="width:150px" onchange="f__name(this,parseInt(#ROWNUM#));"',
p_show_null => 'Yes',
p_null_value => null,
p_null_text => '- Select name -',
p_item_id => 'f01_'|| LPAD (ROWNUM, 4, '0'),
p_item_label => 'Label for f01_#ROWNUM#',
p_show_extra => 'NO') name,
APEX_ITEM.SELECT_LIST_FROM_QUERY(
p_idx => 2,
p_value => c002,
p_query => ' SELECT null d, null r FROM dual WHERE 1 = 2
p_attributes => 'style="width:150px"',
p_show_null => 'Yes',
p_null_value => null,
p_null_text => '- Select name -',
p_item_id => 'f02_'|| LPAD (ROWNUM, 4, '0'),
p_item_label => 'Label for f02_#ROWNUM#',
p_show_extra => 'NO')name2,
from apex_collections
where
collection_name = 'COLLECTION1'
It is fine .
but i want item in tabular form textfield with autocomplete and remove select list. my requirement is using textfield with autocomplete select a employee name and second item textfield with autocomplete display dependent perticular employee related multiple task.
how it is created.i have no idea related textfield with autocomplete.Please help me....pt_user1
I understand that the add row button is currently doing a submit.
To not submit the page you need a dynamic action on the page.
Does the javascript function addRow do what you want?
Otherwise have a look at the following two threads Add row in manual tabular form using dynamic action and Accessing Tabular Form & Add Elements to Collection without Page Submit.
You're process could be something like:
Add the new values to the collection using the idea's in the second thread and at the same time add the new row.
And as second action refresh your tabular form.
If you get stuck set up what you have done on apex.oracle.com using the tables from the demo application.
Nicolette -
Sort Nulls First with Manual Tabular Form????
I just created a manual tabular form and it appears to be in working order. Now I need to order the report results on 2 columns (which I have working using the sort sequence in the column attributes), but I also need the blank row (added row) to appear on top of the results.
What do I need to do to add the blank row on top?? Sort Null: First does not work in my case.
Thank you,
Tammyselect
apex_item.hidden(1,null) log_id,
apex_item.text(2,null) empty_field,
apex_item.text(3,null) log_date,
apex_item.text(4,null) z_time,
apex_item.text(5,null) log_lead,
apex_item.text(6,null) log_event,
apex_item.text(7,null) project_id,
apex_item.text(8,null) status,
apex_item.checkbox(9,null) chkbx,
apex_item.hidden(10,null) seq_id
from dual
connect by level < 4
union all
select
apex_item.hidden(1,c001) log_id,
apex_item.text(2,c002) empty_field,
apex_item.text(3,c003) log_date,
apex_item.text(4,c004) z_time,
apex_item.text(5,c005) log_lead,
apex_item.text(6,c006) log_event,
apex_item.text(7,c007) project_id,
apex_item.text(8,c008) status,
apex_item.checkbox(9,seq_id) chkbx,
apex_item.hidden(10,seq_id) seq_id
from apex_collections
where collection_name = 'LOG_ENTRIES' -
Apex_item.radiogroup using an LOV in a manual tabular form
I'm on APEX 4.0.0.00.46 and I'm sure there must be an obvious solution that I'm missing here, but I'm having a problem setting up an apex_item.radiogroup on a manual tabular form. This is the basic query that I'm using:
select apex_item.radiogroup(37,my_field) as my_field
from my_table
When I use the above query as my Region Source, it compiles fine. However, it seems as though the query won't pull in the value that currently exists in the table unless I set the Column Attribute called 'Display As' for the field to 'Standard Report Column'. When I do this, it seems to remove the capability to incorporate a LOV into the radio group. I'm attempting to incorporate a query like this into the radiogroup:
select 'YES' d, 'Y' r
from dual
UNION ALL
select 'NO' d, 'N' r
from dual
So, to recap, I can set up a Radio Group (query based LOV), but if I do, the query of the table will not pull in the current value from the table. If I change the 'Display As' Column Attribute to 'Standard Report Column', I can no longer incorporate the LOV. Please help if you have any ideas.I am not 100% sure what you are trying to do but I think I am close. Try using
SELECT apex_item.radio_group_from_query
(37,
my_field,
'SELECT ''YES'' d, ''Y'' r FROM dual
UNION ALL
SELECT ''NO'' d, ''N'' r FROM dual'
) AS my_field
FROM my_tableDenes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Manual Tabular Form - APEX_ITEM
Hello All,
I'm trying to build my own custom tabular form. I'm using a PL/SQL to return the query, but am getting "FROM not found where expected".
But the code for declaring the APEX_ITEM is correct.
I've been working on this for 2 days and still have not managed to get up a custom manual tabular form. Thanks for any, I mean any suggestions.
I maybe be corrected, but this may also be simply a custom design/ apex_items on the go.
My goal is to acheive the following on the go
Slot 1 - LOV - LOV
Slot 2 - LOV - LOV
Slot n - LOV - LOVHere is what I see in the debug:
0.04: query could not be parsed:
SELECT apex_item.hidden (31, NULL) apex_item.text (32,1,80,100,'style="width:170px" readonly="readonly"','f32_' LPAD (9900 + 2, 4, '0')), apex_item.hidden (33, NULL) disk_pos_name,
apex_item.select_list_from_lov(34,1,'DISK_TYPE_LOV') disk_id,
apex_item.select_list_from_lov(35,1,'RAID_LOV') raid,
apex_item.select_list_from_lov(36,1,'SLOT_STATUS_LOV') slot_status
FROM DUAL union all SELECT apex_item.hidden (31, NULL) apex_item.text (32,1,80,100,'style="width:170px" readonly="readonly"','f32_' LPAD (9900 + 2, 4, '0')), apex_item.hidden (33, NULL) disk_pos_name,
apex_item.select_list_from_lov(34,1,'DISK_TYPE_LOV') disk_id,
apex_item.select_list_from_lov(35,1,'RAID_LOV') raid,
apex_item.select_list_from_lov(36,1,'SLOT_STATUS_LOV') slot_status
FROM DUAL
failed to parse SQL query:
ORA-00923: FROM keyword not found where expectedHere is the PL/SQL block I'm using:
declare
v_count number;
v_name varchar2(100);
v_retstr VARCHAR2(8000);
begin
select disk_slots into v_count from ori_inventory where inventory_id = '142'; --tester value
v_name := '';
for i in 1 .. v_count loop
v_name := '''Slot '|| i ||'''';
v_retstr := v_retstr ||
'SELECT apex_item.hidden (31, NULL) ' ||
'apex_item.text (32,'|| 1 ||',80,100,''style="width:170px" readonly="readonly"'',''f32_'' LPAD (9900 + 2, 4, ''0'')), ||
apex_item.hidden (33, NULL) disk_pos_name,
apex_item.select_list_from_lov(34,1,''DISK_TYPE_LOV'') disk_id,
apex_item.select_list_from_lov(35,1,''RAID_LOV'') raid,
apex_item.select_list_from_lov(36,1,''SLOT_STATUS_LOV'') slot_status
FROM DUAL ';
if i < v_count then v_retstr := v_retstr||' union all '; end if;
end loop;
return v_retstr;
--dbms_output.put_line(v_retstr);
end;Is there a missing concatenate operator here:
'f32_' LPAD (9900 + 2, 4, '0')
Scott -
Select List in Manual Tabular Form based on a previous column
I have a manual tabular form that have several columns One column (vendor) is a select list that should be based on a previous column (Vendor Type - Internal/External). So if the user selects Internal for Vendor Type, the Vendor column's select list should only contain those vendors with type of Internal. By the way, it also uses APEX collections.
select
apex_item.hidden (1,C015) STATUS,
apex_item.checkbox (2,SEQ_ID,'title="check to delete"') CHECKBOX,
case
when (c001 is not null and c002 is not null) then
'<a onclick="return false;" href="f?p='||:APP_ID||':20:'||:APP_SESSION||'::NO:20:P20_ID,P20_REQ_ID,P20_SEQ_ID:'||C001||','||C002||','||SEQ_ID||'"><img alt="" src="/i/ed-item.gif"></a>'
end ||
apex_item.hidden (4,C001) ID,
apex_item.hidden (5,C002) JOB_QUOTE_ID,
apex_item.date_popup2 (6,C003,'MM/DD/YYYY',11,2000,'onChange="f_set_end_date(this.id,'|| ROWNUM || ');"') ||
apex_item.select_list_from_query (7,C004,'select svcs_description d, svcs_code r from csrsr_service_codes order by 1 asc',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.date_popup2 (8,C005,'MM/DD/YYYY',11) ||
apex_item.text (9,C006,8,15,'style="text-align:right;"') || '<BR />' ||
apex_item.select_list (10,C007,'Staff;S,External;E',null,'YES',null,'-Select-') ||
apex_item.select_list_from_query_xl(11,C008,'select vendor_name d, vendor_number r from csrsr_vendors_v',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.text (12,C009,50,100,'colspan=2') COL12,
apex_item.text (13,to_char(to_number(C010),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT1,
apex_item.text (14,to_char(to_number(C011),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT2,
apex_item.text (15,to_char(to_number(C012),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT3,
apex_item.text (16,to_char(to_number(C013),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT4,
apex_item.hidden (24,C001) ||
apex_item.hidden (25,C002) ||
apex_item.hidden (3,SEQ_ID) ||
apex_item.text (17,to_char(to_number(C014),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') CHBK_AMT,
'value' COLTYPE
from
apex_collections
where
collection_name = 'CSRSR_JOBCOSTS_C' and
C015 in ('O','U','N')
union all
select
apex_item.hidden (1,null) STATUS,
apex_item.checkbox (2,null,'title="check to delete"') CHECKBOX,
apex_item.hidden (24,null) ||
apex_item.hidden (4,null) ID,
apex_item.hidden (25,null) ||
apex_item.hidden (5,null) JOB_QUOTE_ID,
apex_item.date_popup2 (6,null,'MM/DD/YYYY',11,2000,'onChange="f_set_end_date(this.id,'|| ROWNUM || ');"') ||
apex_item.select_list_from_query (7,null,'select svcs_description d, svcs_code r from csrsr_service_codes order by 1 asc',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.date_popup2 (8,null,'MM/DD/YYYY',11) ||
apex_item.text (9,null,8,15,'style="text-align:right;"') || '<BR />' ||
apex_item.select_list (10,null,'Staff;S,External;E',null,'YES',null,'-Select-') ||
apex_item.select_list_from_query_xl(11,null,'select vendor_name d, vendor_number r from csrsr_vendors_v',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.text (12,null,50,100,'colspan=2') COL12,
apex_item.text (13,null,10,15,'style="text-align:right;"') AMT1,
apex_item.text (14,null,10,15,'style="text-align:right;"') AMT2,
apex_item.text (15,null,10,15,'style="text-align:right;"') AMT3,
apex_item.text (16,null,10,15,'style="text-align:right;"') AMT4,
apex_item.hidden (24,null) ||
apex_item.hidden (25,null) ||
apex_item.hidden (3,null) ||
apex_item.text (17,null,10,15,'style="text-align:right;"') CHBK_AMT,
'value' COLTYPE
from
dual
How can I accomplish this?
Application Express 4.1.2
Oracle 10g Rel 2
RobertHi,
Then you are probably looking cascading select list in tabular form?
http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:2003800346210117
Regards,
Jari -
Manual tabular form -- add rows
Hi everybody, I am making a manually tabular form following the Denes Kubicek tutorials:
http://apex.oracle.com/pls/otn/f?p=31517:170:1304244099066416::NO
and
http://apex.oracle.com/pls/otn/f?p=31517:190:1304244099066416::NO
The SQL for the tabular form is:
SELECT apex_item.checkbox (31,
idint,
'onclick="highlight_row(this,' || ROWNUM || ')"',
NULL,
'f31_' || LPAD (ROWNUM, 4, '0')
) delete_checkbox,
idint,
apex_item.text (32,
tipus_modif,
1,
1,
'style="width:20px" ',
'f32_' || LPAD (ROWNUM, 4, '0')
) tipus
FROM GPPC_DETALLS_ESMENA_PROP_V
where esmena_idint = :P18_IDINT
and tipus_modif ='A'
The Report is created correct. Now I modify the "Form Region" template like this:
<table class="t6FormRegion" id="MY_TAB" border="0" cellpadding="0" #REGION_ATTRIBUTES# summary="">
<tr><td class="t6Header">#TITLE#</td></tr>
<tr><td class="t6ButtonHolder">#CLOSE# #PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td></tr>
<tr><td class="t6Body">#BODY#</td></tr>
<tr><td><img src="#IMAGE_PREFIX#themes/theme_6/t.gif" width="400" height="1" alt="" /></td></tr>
</table>
Now I add a Button URL with the code:
javascript:va_AddTableRow(this,'MY_TAB',1);
and add this Javascript in the region header of the SQL Report
<script>
function va_AddTableRow(pThis,pThat,pNum){
var tt = html_GetElement(pThat);
for(i=0;i<pNum;i++){
var ogTR = tt.rows[1];
var trClone = ogTR.cloneNode(true);
trClone.firstChild.innerHTML='(null)';
var last_child=trClone.lastChild.getElementsByTagName('input')
for (var j=0;j<last_child.length;j++)
if (last_child[j].type=="hidden" && last_child[j].name=="f01")
last_child[j].value="";
if(document.all){
myNewRow = tt.insertRow(tt.rows.length);
oReplace = myNewRow.replaceNode(trClone);
}else{
tt.appendChild(trClone);
</script>
In this moment, when I push the botton appears the text (nulll) in the same region but not as a new line in the SQL report, what is the problem??
Thank you for your helpAlberto,
When you get a chance, see if maybe this (old version) of my app does something similar to what you need/want.
[http://apex.oracle.com/pls/otn/f?p=26115:3]
It's not working right now though, I keep getting the Oracle error:
ORA-01116: error in opening database file 17252 ORA-01110: data file 17252: '/u03/oradata/marvlprd/MARVLPRD/datafile/o1_mf_flow_172_23qtsjpr_.dbf' ORA-27041: unable to open file Linux Error: 23: Too many open files in system Additional information: 3
So, as way of an explanation (until Joel gets the Linux process fixed), I have a simple little screen that I use for letting the users specifiy search criteria. Each line has four columns, what field they want to search, a condition (equals or not equals), the text to search for, and an optional 'And/or' argument. If the 'And/Or' gets populated, a new blank line automatically gets created. There is also a red 'X' on each line so they users can delete a line if they want.
Not sure if this is what you need, but this page uses the same set of javascript code, so perhaps when it's working again, you can see if there are any similarities or differences.
Also, for reference, so you can see the code and variables, etc., the workspace is wbfergus, and the id and password are both htmldb-apex.
Bill Ferguson -
Creating a manual tabular form on an empty table
Hi all,
I am trying to create a manual tabular form on an empty table. Is it possible to display textboxes and column headers, when I run the report I get "no data found".
Regards,Hi Denes and thank you for your valuable input.
My problem is in fact that, I have created the tabular form by using a report region with a SQL query, something like,
select apex_item.display_and_save(1, p.bolge) bolge,
apex_item.display_and_save(2, p.hafta) hafta,
apex_item.display_and_save(3, p.yil) yil,
apex_item.display_and_save(4, p.mamul) mamul,
apex_item.display_and_save(5, p.tahmin1) tahmin1,
apex_item.display_and_save(6, p.tahmin2) tahmin2,
apex_item.display_and_save(7, p.tahmin3) tahmin3,
apex_item.display_and_save(8, p.tahmin4) tahmin4,
apex_item.display_and_save(9, p.tahmin5) tahmin5,
apex_item.display_and_save(10, p.tahmin6) tahmin6,
apex_item.display_and_save(11, p.revize4) revize4,
apex_item.display_and_save(12, p.revize5) revize5,
apex_item.display_and_save(13, p.revize6) revize6
from portal_link.v_planlama p
The problem is that, since there is no data in the table, when I run the page, I cant get the form to be rendered, and I get a nice "no data found". There should be a way to get the form rendered, hence making it available for data input.
Regards,
Onur -
Can't get Delete Process to work on Manual Tabular Form
Help. My insert and update process works just fine. I can't get the delete process to work. I've searched the forum and found a couple of examples on what to do, but I can't get the examples to work. I get an ORA-01403: no data found error.
Report SQL:
select apex_item.checkbox (1, ceah_people_lang_id,'unchecked') delete_checkbox,
--'onclick="highlight_row(this,' || ROWNUM || ')"',
--null,
--'F1_' || LPAD (ROWNUM, 4, '0')) delete_checkbox,
Delete Process:
declare
begin
for i in 1..apex_application.g_f02.count
loop
--if apex_application.g_f01(i) = 'Y'
--then
delete from ceah_people_language
where ceah_people_lang_id = to_number(apex_application.g_f01(i));
--end if;
end loop;
end;
I've spent more time than I care to admit on the manual tabular form. Any help would be appreciated. Thanks, Elizabethselect apex_item.checkbox (1, ceah_people_lang_id,'unchecked') delete_checkbox,
--'onclick="highlight_row(this,' || ROWNUM || ')"',
--null,
--'F1_' || LPAD (ROWNUM, 4, '0')) delete_checkbox,
apex_item.hidden(2,ceah_people_lang_id)
||
apex_item.select_list_from_query(3,language_id,'select language_name, language_id from foreign_language') language_id,
apex_item.hidden(4,ceah_people_id) ||
apex_item.select_list_from_query(5,proficiency,'select name, id from proficiency') proficiency
from ceah_people_language where ceah_people_language.ceah_people_id = :P152_person_id
union all
select apex_item.checkbox
(1,
null,
'onclick="highlight_row(this,' || ROWNUM || ')"',
null,
'F1_' || LPAD (ROWNUM, 4, '0')) delete_checkbox,
apex_item.hidden(2,null) ||
apex_item.select_list_from_query(3,null,'select language_name, language_id from foreign_language',
'style="width:170px" ' ,
'YES',
'0',
'- Select Foreign Language -',
'f3_' || LPAD (9900 + ROWNUM, 4, '0'),
NULL,
'NO'
) language_id,
apex_item.hidden(4,null) ||
apex_item.select_list_from_query(5,null,'select name, id from proficiency',
'style="width:170px" ' ,
'YES',
'0',
'- Select Proficiency -',
'f5_' || LPAD (9900 + ROWNUM, 4, '0'),
NULL,
'NO'
) proficiency
from dual where :request = 'ADD_ROWS'
connect by level <= 2 -
How to Multi Row Update function in Manual Tabular Form
Hi All,
In my application I am using manual tabular form, for Update and insert i have written pl/sql process,
but i want to make use of MULTI_ROW_UPDATE function for update and insert operations.
How can I implement default tabular form behaviour in manual tabular form.
I am using:
Oracle Database 11g
ApEx Version 4.0
please help me, it's urgent.
thanks
MRHi Joao,
First Can u pl let us know your view is based on how many
tables?
If it is a simple view ,you can open the form in update mode
passing a parameter to it thru a procedure or thru a url or what
ever you feel like(form to form,etc)..I will give you an example
on how to open the form in update mode like below..
1.develop a form based on a simple view
2.Call that form Thru a simple URL
3.In the above you are opening a form with module id
ex:1234567890 in update mode and change portal30 to suit
accordingly..
4.You are passing a parameter called "ABCDEF" TO "NAME" Field to
that form for querrying..
5.Now the form will be opened in update mode and all the fields
are pertaining to the parameter "ABCDEF" and you can update the
fields....
II..Now regarding the check boxes i need to know which version
of the portal are u using..As for as my knowledge goes (up to
3.0.6) there are lot of bugs with the check boxes and check box
checked value is always "yes"(if u want to insert in to the data
base).So try not to depend on checkboxes and instead Combo is
the right answer till oracle portal is free of bugs.
No triggers are required for your requirement....
Hope i have answered your problem ...If any please revert back
with full details
Thanks
Vishnu Singireddy -
Checksum error in Manual Tabular Form
Hi everyone,
I have created 2 (manual tabular forms) on a same page but i am getting checksum error for one of the tabular form.
Here is my code:
1 st Tabular Form:
select
x.del,
x.ECGEXST_ID,
x.LEAD_CD,
x.ST_ID,
x.ENTERED_DTS,
X.ENTERED_BY_NM,
X.UPDATED_DTS,
X.UPDATED_BY_NM,
x.cks
from (
select
htmldb_item.checkbox(1,ECGEXST_ID) del,
htmldb_item.hidden(2,ECGEXST_ID) ECGEXST_ID,
htmldb_item.select_list_from_query (3, LEAD_CD,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(5,ST_ID,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 17',25) ST_ID,
wwv_flow_item.display_and_save(6,to_char(ENTERED_DTS,'MM/DD/YYYY')) ENTERED_DTS,
au.LAST_NM || ', ' || au.FIRST_NM ENTERED_BY_NM,
wwv_flow_item.display_and_save(7,to_char(UPDATED_DTS,'MM/DD/YYYY')) UPDATED_DTS,
au1.LAST_NM || ', ' || au1.FIRST_NM UPDATED_BY_NM,
htmldb_item.md5_checksum(ECGEXDT_ID,LEAD_CD,ST_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
from ECGEXST,
app_user au,app_user au1 where au.MSPR_ID(+) = ECGEXST.ENTERED_BY_MSPR_ID and au1.MSPR_ID(+) = ECGEXST.UPDATED_BY_MSPR_ID
and ECGEXDT_ID = :P65_ECGEXDT_ID
union all
select
htmldb_item.checkbox(1,null) del,
htmldb_item.hidden(2,null) ECGEXST_ID,
htmldb_item.select_list_from_query (3,null,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(5,null,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 17',25) ST_ID,
wwv_flow_item.display_and_save(6,null) ENTERED_DTS,
null ENTERED_BY_NM,
wwv_flow_item.display_and_save(7,null) UPDATED_DTS,
null UPDATED_BY_NM,
htmldb_item.md5_checksum(null,null,null,null,null) cks
from dual) x
UPDATE PROCESS:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
val1 varchar2(100);
val2 varchar2(100);
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,ST_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO
l_cks
from ECGEXST where ECGEXDT_ID = :P65_ECGEXDT_ID;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
for i in 1..l_cks.count
loop
if htmldb_application.g_fcs(i) != l_cks(i) then
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
-- return;
end if;
end loop;
-- update ECGRSTST
for i in 1..htmldb_application.g_f02.count
loop
if htmldb_application.g_f02(i) is not null then
update ECGEXST
set
ECGEXDT_ID = :P65_ECGEXDT_ID,
LEAD_CD = replace(htmldb_application.g_f03(i),'%'||'null%',NULL),
ST_ID = replace(htmldb_application.g_f05(i),'%'||'null%',NULL)
where ECGEXST_ID = htmldb_application.g_f02(i);
else
if htmldb_application.g_f03(i) is not null then
insert into ECGEXST
(ECGEXST_ID ,
ECGEXDT_ID,
LEAD_CD,
ST_ID)
values
(ECGEXST_SEQ.nextval,
:P65_ECGEXDT_ID,
replace(htmldb_application.g_f03(i),'%'||'null%',NULL),
replace(htmldb_application.g_f05(i),'%'||'null%',NULL));
end if;
end if;
end loop;
end;
The first tabular form is working fine.But for the second tabular form i am getting the checksum error.I have created a test table and checked the checksum values.The checksum values are changing.
Here is the code of my 2nd tabularform:
select
x.del,
x.ECGEXT_ID,
x.LEAD_CD,
x.T_ID,
x.ENTERED_DTS,
X.ENTERED_BY_NM,
X.UPDATED_DTS,
X.UPDATED_BY_NM,
x.cks
from (
select
htmldb_item.checkbox(11,ECGEXT_ID) del,
htmldb_item.hidden(12,ECGEXT_ID) ECGEXT_ID,
htmldb_item.select_list_from_query (13, LEAD_CD,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(15,T_ID,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 18',25) T_ID,
wwv_flow_item.display_and_save(16,to_char(ENTERED_DTS,'MM/DD/YYYY')) ENTERED_DTS,
au.LAST_NM || ', ' || au.FIRST_NM ENTERED_BY_NM,
wwv_flow_item.display_and_save(17,to_char(UPDATED_DTS,'MM/DD/YYYY')) UPDATED_DTS,
au1.LAST_NM || ', ' || au1.FIRST_NM UPDATED_BY_NM,
htmldb_item.md5_checksum(ECGEXDT_ID,LEAD_CD,T_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
from ECGEXT,
app_user au,app_user au1 where au.MSPR_ID(+) = ECGEXT.ENTERED_BY_MSPR_ID and au1.MSPR_ID(+) = ECGEXT.UPDATED_BY_MSPR_ID
and ECGEXDT_ID = :P65_ECGEXDT_ID
union all
select
htmldb_item.checkbox(11,null) del,
htmldb_item.hidden(12,null) ECGEXT_ID,
htmldb_item.select_list_from_query (13,null,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(15,null,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 18',25) T_ID,
wwv_flow_item.display_and_save(16,null) ENTERED_DTS,
null ENTERED_BY_NM,
wwv_flow_item.display_and_save(17,null) UPDATED_DTS,
null UPDATED_BY_NM,
htmldb_item.md5_checksum(null,null,null,null,null) cks
from dual) x
UPDATE PROCESS:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
val1 varchar2(100);
val2 varchar2(100);
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,T_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO l_cks
from ECGEXT where ECGEXDT_ID = :P65_ECGEXDT_ID;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
for i in 1..l_cks.count
loop
if htmldb_application.g_fcs(i) != l_cks(i) then
-- val1 := htmldb_application.g_fcs(i);
-- val2 := l_cks(i);
-- insert into test2 (val_1,val_2) values (val1,val2);
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
return;
end if;
end loop;
-- update ECGRSTST
for i in 1..htmldb_application.g_f12.count
loop
if htmldb_application.g_f12(i) is not null then
update ECGEXT
set
ECGEXDT_ID = :P65_ECGEXDT_ID,
LEAD_CD = replace(htmldb_application.g_f13(i),'%'||'null%',NULL),
T_ID = replace(htmldb_application.g_f15(i),'%'||'null%',NULL)
where ECGEXT_ID = htmldb_application.g_f12(i);
else
if htmldb_application.g_f13(i) is not null then
insert into ECGEXT
(ECGEXT_ID ,
ECGEXDT_ID,
LEAD_CD,
T_ID)
values
(ECGEXT_SEQ.nextval,
:P65_ECGEXDT_ID,
replace(htmldb_application.g_f13(i),'%'||'null%',NULL),
replace(htmldb_application.g_f15(i),'%'||'null%',NULL));
end if;
end if;
end loop;
end;
please help me in solving this.The same code its good for one tabular form and for the other it giving the checksum error.
Thanks in advance
phaniHi patrick,
Thanks for the reply i am getting the checksum error even if i used my primary key in the select statement of the MD5 checksum.
My primary key in the second tabular form is
htmldb_item.hidden(12,ECGEXT_ID) ECGEXT_ID
so i changed the process to:
for i in 1..htmldb_application.g_f12.count
loop
if htmldb_application.g_f12(i) is not null
then
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,T_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO l_cks
from ECGEXT where ECGEXT_ID = htmldb_application.g_f12(i);
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
if htmldb_application.g_fcs(i) != l_cks(i) then
-- val1 := htmldb_application.g_fcs(i);
-- val2 := l_cks(i);
-- insert into test2 (val_1,val_2) values (val1,val2);
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
end if;
end if;
end loop;
It's not possible to use BULK COLLECT to get the MD5 checksum of all >>>rows. Because the index positions in the MD5 array and the >>>apex_application.g_fxx array index will probably not match, especially if you >>>don't order or if you are on a second page.How come the first tabular form is running i used the bulk collect in the first tabular form
HERE IS THE CODE FOR THE FIRST TABULAR FORM:
-- Get original MD5 checksum
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,ST_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO
l_cks
from ECGEXST where ECGEXDT_ID = :P65_ECGEXDT_ID;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
for i in 1..l_cks.count
loop
if htmldb_application.g_fcs(i) != l_cks(i) then
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
-- return;
end if;
end loop; -
Delete Functionality in manual tabular form
Hi everyone,
I have created 2 tabular forms on the same page.everthing is working fine.Both the tabular form are able to insert and update.I am getting problem to implement the DELETE functionality in those tabular form.
I inserted this code htmldb_item.checkbox(6, id) del in the region and i created a delete process.But i am getting (no data found) error.
could anyone help me in solving this.
thanks
phani
===========================================================
DELETE PROCESS:
FOR i in 1..HTMLDB_APPLICATION.G_F01.count
LOOP
DELETE FROM (TABLE NAME)
WHERE id = HTMLDB_APPLICATION.G_F06(i);
END LOOP;
=============================================================
TABULAR FORM 1:
REGION:
select x.column1,
x.column2,
x.column3,
x.column4,
x.column5,
x.del,
x.cks
from (
select htmldb_item.hidden(1,column1) column1,
htmldb_item.text(2,column2,10) column2,
htmldb_item.text(3,column3,10) column3,
htmldb_item.text(4,column4,10) column4,
wwv_flow_item.date_popup(5,null,column5) column5,
htmldb_item.checkbox(6,column1) del,
htmldb_item.md5_checksum(column2,column3,column4,column5) cks
from TABLENAME
union all
select htmldb_item.hidden(1,null) column1,
htmldb_item.text(2,null,10) column2,
htmldb_item.text(3,null,10) column3,
htmldb_item.text(4,null,10) column4,
wwv_flow_item.date_popup(5,null,null) column5,
htmldb_item.checkbox(6,null) del,
htmldb_item.md5_checksum(null,null,null,null) cks
from dual) x
==================================================================
PROCESS:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(column2,column3,column4,column5) cks
BULK COLLECT INTO
l_cks
from TABLE;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
-- for i in 1..l_cks.count
-- loop
-- if htmldb_application.g_fcs(i) != l_cks(i) then
-- rollback;
-- raise_application_error(
-- -20001,
-- 'Current version of data in database has changed '||
-- 'since user initiated update --process.');
--return;
-- end if;
-- end loop;
-- update
for i in 1..htmldb_application.g_f01.count
loop
if htmldb_application.g_f01(i) is not null then
update TABLENAME
set column2= htmldb_application.g_f02(i),
column3 = htmldb_application.g_f03(i),
column4 = htmldb_application.g_f04(i),
column5 = htmldb_application.g_f05(i)
where column1 = htmldb_application.g_f01(i);
else
if htmldb_application.g_f03(i) is not null then
insert into TABLE
(column2,
column3,
column4,
column5
values
(htmldb_application.g_f02(i),
htmldb_application.g_f03(i),
htmldb_application.g_f04(i),
htmldb_application.g_f05(i));
end if;
end if;
end loop;
end;
I created the other tabular form on the same page with
htmldb_application.g_f11(i)
htmldb_application.g_f12(i)
htmldb_application.g_f13(i)
htmldb_application.g_f14(i)
used the same code.Have you got any response on this? I would like to know how to do it too. I am trying to implement a manual tabular form on a page and need this functionality.
I do know one thing. After attending the ODTUG conference last week, Raj said something about you have to process check boxes and radio groups separately from the rest of the form.
Thanks,
Michelle -
Column Link is not working on a Manual Tabular Form
Hello,
I am having some issues creating a link on a column based on a manual tabular form (I am using Apex 4.1.1.00.27, Oracle DB 10.2.0.5.0):
On my page 1, I created a process that deletes and creates a collection based on the “emp” table; then, I have a manual tabular form based on that collection; and finally, a link on the “deptno” column of the manual tabular form that points to my Page 2 (department form) and it’s passing the parameter P2_DEPTNO:#DEPTNO#.
The problem is that when I press the link, the page is not submitting the DEPTNO value. Also, I notice that as soon as I specify the column as a link column, it does not show the value in my tabular form, but if I remove the link, it shows the value correctly.
I created an example on apex.oracle.com in case some of you want to look into it:
Workspace: EDIAZJORGE
Username: test
Password: test123
App Name: Sample App
App Number: 12231
I appreciate any ideas or suggestions on how to solve this issue.
Thank you,
ErickHello,
Try following code
SELECT APEX_ITEM.HIDDEN(1,C001) EMPNO,
APEX_ITEM.TEXT(2,C002) ENAME,
APEX_ITEM.TEXT(3,C003) JOB,
APEX_ITEM.TEXT(4,C004) MGR,
APEX_ITEM.TEXT(5,C005) HIREDATE,
APEX_ITEM.TEXT(6,C006) SAL,
APEX_ITEM.TEXT(7,C007) COMM,
'<a href="f?p=&APP_ID.:2:&APP_SESSION.:::2:P2_DEPTNO:'||C008||'"><img src="/i/ws/small_page.gif"></a>' DEPTNO
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'EMP_COLLECTION'
UNION ALL
SELECT APEX_ITEM.HIDDEN(1,NULL) EMPNO,
APEX_ITEM.TEXT(2,NULL) ENAME,
APEX_ITEM.TEXT(3,NULL) JOB,
APEX_ITEM.TEXT(4,NULL) MGR,
APEX_ITEM.TEXT(5,NULL) HIREDATE,
APEX_ITEM.TEXT(6,NULL) SAL,
APEX_ITEM.TEXT(7,NULL) COMM,
APEX_ITEM.TEXT(8,NULL) DEPTNO
FROM DUALFor existing data, it will display as link and for new data, it will still display as text box.
Please note that you should display DEPTNO as standard column and not as LINK.
Regards,
Hari
Escaped < in tags :) -
Hi friends,
I have been working on a timesheet application for which i need to create a manual tabular form in apex 4.1. I created a page with 3 items based on whose values the form should be generated. I created a report region in the page with the source code as
DECLARE
v_query varchar2(10000);
BEGIN
IF :P7_RELEASE_ID is not null THEN
v_query := 'SELECT b.act_code activities,
apex_item.text (1, a.ts_wd1, 10, 10) monday,
apex_item.text (2, a.ts_wd2, 10, 10) tuesday,
apex_item.text (3, a.ts_wd3, 10, 10) wednesday,
apex_item.text (4, a.ts_wd4, 10, 10) thursday,
apex_item.text (5, a.ts_wd5, 10, 10) friday,
apex_item.text (6, a.ts_wd6, 10, 10) saturday,
apex_item.text (7, a.ts_wd7, 10, 10) sunday,
apex_item.text (8, a.ts_remarks, 70, 128) remarks
from tb_opti_emp_ts a, tb_opmi_proj_act_map b
where a.proj_ref=b.proj_ref= '||:P7_PROJ_REF||' and a.rel_id=b.rel_id= '||:P7_RELEASE_ID||' and a.emp_id= '||:P7_EMPLOYEE;
ELSE
v_query := 'SELECT 1 FROM dual WHERE 1=0';
END IF;
return(v_query);
END;
I have checked the option 'Use Generic Column Names (parse query at runtime only)' under source and the type is SQL query(pl/sql function body returning sql query)
in this the 3 page items are P7_PROJ_REF,P7_RELEASE_ID and P7_EMPLOYEE.
Now i have created a button which unconditionally branches to the same page and submits the page so on clicking it the data should be generated. I am getting the 'no data found' when the page items are blank but when i am passing legit data in the items(btw, all three are pop-up LOV's), i am getting an error
failed to parse SQL query:
ORA-00933: SQL command not properly ended.
Please I have been working for hours but not getting the solution...
Anyone with solution plz.............Put your actual query in the report region SQL Query box, Specifying SQL Query as opposed to Function Returning SQl Query
As follows:
SELECT b.act_code activities,
apex_item.text (1, a.ts_wd1, 10, 10) monday,
apex_item.text (2, a.ts_wd2, 10, 10) tuesday,
apex_item.text (3, a.ts_wd3, 10, 10) wednesday,
apex_item.text (4, a.ts_wd4, 10, 10) thursday,
apex_item.text (5, a.ts_wd5, 10, 10) friday,
apex_item.text (6, a.ts_wd6, 10, 10) saturday,
apex_item.text (7, a.ts_wd7, 10, 10) sunday,
apex_item.text (8, a.ts_remarks, 70, 128) remarks
from tb_opti_emp_ts a, tb_opmi_proj_act_map b
where a.proj_ref=b.proj_ref= :P7_PROJ_REF and a.rel_id=b.rel_id= :P7_RELEASE_ID and a.emp_id= :P7_EMPLOYEE;In the conditions for the report region to display specify ITEM NOT NULL and P7_RELEASE_ID (without the colon) in the Expression 1 box -
Sorting on date (date_popup2) in manual tabular form does not work
Hi All,
I created a manual tabular form (based on a collection) with 1 date_popup2 field in it. This field is defined in the query as follows:
, apex_item.date_popup2( p_idx => 18
, p_value => c004
, p_date_format => 'dd-mm-yyyy'
, p_item_id => 'f18_' || lpad (rownum, 4, '0')
, p_item_label => 'Start date'
) as tf_br_start_date
In the report attributes I marked this column to be sortable.
However, in the page the sorting is not working. It looks like it's always sorted in the order of the seq_id.
Can anyone tell me how to solve this?
Regards,
RenéI'd call it a bug/missing feature.
It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
I'd file this with Oracle Support and see what they say.
Include a link to this thread and your workspace login information.
I got something to work by: (probably not what you want.)
using the C004 column directly. (I just added it to the SQL code)
setting the column's attribute "Display As" to "Date Picker"
setting the column's attribute "Number /Date Format" to DD-MM-YYYY
I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
MK
Maybe you are looking for
-
Ora-01219 database not open; only queries on fixed tables and views.
Hi everyone There is another post stating this error, but since the source is different, I think is okay to make a different post as well. Our database was working fine until the other day, when suddenly power went off, UPS was damaged and didn't hol
-
How to fix this is who in the picture ?
I use this script in server 2008 R2 for Storing Windows Event Viewer Output in a SQL Server table with PowerShell : foreach ($server in Get-Content c:tempservers.txt) { $variable = ( Get-EventLog -ComputerName $server -LogName Security -After "22-08-
-
I used to easily be able to set the dimensions from document setup when i was working on a project, I cant do that now - but whats more frustrating is the crop area tool is gone - can anyone tell me how to only crop 1 item in a document so when I sav
-
Function is grayed-out and can't be controlled when I try to create a mouseover
I am working on a very simple animation where I have an image that is supposed to have a mouseover effect. When I click on Open Action everything is fine and the same is true for when I choose mouseover. However, when I try to insert a "play" or "pla
-
At line selection & at user comand help?
hi i had an req like,to disply an list 1,than perform the BDC for the selected material with check box from list 1,than after BDC,the data is displaed on list 2 with the VBELN no.,along with there BDC msg,now user want to click on each VBELN records