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
Similar Messages
-
Query for create manual tabular form using apex collection add row button functionality
Hello everyone
My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
Thanks & Regards,
UjwalaUjwala
Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
Could you answer the question about what you see while debug the javascript code.
If you don't understand the question or have trouble debug javascript let us know.
Nicolette -
Need Help Creating Manual Tabular Form
Hello,
I am trying to use Denes Kubicek example. [http://htmldb.oracle.com/pls/otn/f?p=31517:170:370485826041084::NO]
I am not getting any errors; however, my table is not getting updated.
Updatable Query:
SELECT DISTINCT
apex_item.HIDDEN(1,PE_BID) PE_BID,
apex_item.HIDDEN(2,PE_TERM_CODE) PE_TERM_CODE,
apex_item.HIDDEN(3,PE_CRN) PE_CRN,
apex_item.HIDDEN(4,PE_INSTRUCTOR_ID) PE_INSTRUCTOR_ID,
PE_BID PE_BID_DISPLAY,
SUBSTR(PE_STUDENT_NAME, (INSTR(PE_STUDENT_NAME, ',') + 1),77)|| ' ' ||
SUBSTR(PE_STUDENT_NAME, 1,(INSTR(PE_STUDENT_NAME, ',') - 1)) Stu_Name,
PE_ATH_CODES Sport,
PE_CRN PE_CRN_DISPLAY,
PE_CRSE_SUBJECT || ' ' || PE_CRSE_NUMBER || '.'||PE_CRSE_SECTION COURSE,
apex_item.SELECT_LIST(5,PE_SATTEND,'YES;YES,NO;NO') PE_SATTEND,
apex_item.SELECT_LIST(6,PE_SPERFORM,'YES;YES,NO;NO') PE_SPERFORM,
apex_item.SELECT_LIST(7,PE_MAKE_APPT,'YES;YES,NO;NO') PE_MAKE_APPT,
apex_item.TEXTAREA(8,PE_COMMENTS,3,30) PE_COMMENTS,
apex_item.TEXT(9,PE_ACTIVITY_DATE,15) PE_ACTIVITY_DATE
FROM PC_ST_TB_INSTR_ATHL_PR_ENTRY
WHERE PE_TERM_CODE = :P4_TERM
AND (PE_INSTRUCTOR_ID = :P4_DISPLAY_INSTRUCTOR_ID
OR PE_INSTRUCTOR_ID = :P4_DISPLAY_INSTRUCTOR_ID2)Page Process:
DECLARE
v_updatecount NUMBER := 0;
BEGIN
FOR i IN 1 .. apex_application.g_f01.COUNT
LOOP
UPDATE PC_ST_TB_INSTR_ATHL_PR_ENTRY
SET pe_sattend = apex_application.g_f05(i),
pe_sperform = apex_application.g_f06(i),
pe_make_appt = apex_application.g_f07(i),
pe_comments = apex_application.g_f08(i),
pe_activity_date = apex_application.g_f09(i)
WHERE pe_instructor_id = apex_application.g_f04(i)
AND pe_bid = apex_application.g_f01(i)
AND pe_term_code = apex_application.g_f02(i)
AND pe_crn = apex_application.g_f03(i);
v_updatecount := v_updatecount + 1;
END LOOP;
:P4_DISPLAY_COUNT := v_updatecount;
END;I can't use the wizard because it appears to only allow for 2 primary keys. My table has 4.
Regards,
KellyHi,
The first thing to do is concatenate the HIDDEN items in front of a displayed item:
SELECT DISTINCT
apex_item.HIDDEN(1,PE_BID) || apex_item.HIDDEN(2,PE_TERM_CODE) || apex_item.HIDDEN(3,PE_CRN) || apex_item.HIDDEN(4,PE_INSTRUCTOR_ID) || PE_BID PE_BID_DISPLAY,
..etc..That way, you don't have to worry about the first 4 columns in the report.
Then you need to double-check that the process is actually being run. Immediately after the BEGIN line, enter:
raise_application_error(apex_application.g_f01(1));When you submit the page, you should get an error showing the PE_BID value in the first row. If you don't get the error, then the process isn't being run - in which case, check the process to (A) make sure it is triggered by the Submit button and (B) is before any other sequence (especially if you have a "reset page" process). If you do get the error, but there is no value shown, then f01(1) isn't pointing to the PE_BID value - in which case, you should do a View Source on the loaded page and check for input items with a name attribute of "f01". If you get the error and the value is correct, then remove the above line and let the process run - it could be that concatenated the columns may resolve the issue. If, after all that, the process still won't save the data, let us know.
Andy -
Display select list from query on manual tabular form
Hello,
I'm trying to display a select list from query on a manual tabular form. I'm using a collection to store the data. I can't seem to get the query to work. I can display the item as a text item. Any help would be appreciated. Thanks, Elizabeth.
SELECT
-- Notice how I'm keeping the idx value the same as the column value in the collection. This helps to keep things organized
-- I also apply an id to each entry
-- I append the error value to the empname and sal
-- The Seq_id. Usefull when hiding rows (for delete) and then submitting from
apex_item.hidden(1,x.seq_id, null, x.seq_id || '_seq_id') ||
-- The Primary Key of the column
apex_item.hidden(2, x.ceah_people_id, null, x.seq_id || '_ceah_people_id') || x.ceah_people_id ceah_people_id,
-- Employee Name
case when x.seq_id = -1
then
apex_item.select_list_from_query (3,
NULL,
'select distinct language_name d, '
|| 'language_id r from foreign_language',
'style="width:170px" ' ,
'YES',
'0',
'- Select Language -',
'x.seq_id_' || LPAD (9900 + LEVEL, 4, '0'),
NULL,
'NO'
else
apex_item.text (3,(select language_name from foreign_language where x.language_id = foreign_language.language_id),
80,
100,
'style="width:170px" readonly="readonly"',
'f32_' || LPAD (ROWNUM, 4, '0')
end
|| err.language_id language_id,
/* apex_item.text(3,x.language_id,null, null, null, x.seq_id || '_language_id') || err.language_id language_id,
-- Employee Salary
apex_item.text(4,x.proficiency, null, null, null, x.seq_id || '_proficiency') || err.proficiency ||
-- Store the sql action type as well.
apex_item.hidden(50,x.sql_action_typ, null, x.seq_id || '_sql_action_typ_id') proficiency,
-- Last but not least the row error
err.row_error
FROM (SELECT ac.c001 seq_id,
ac.c002 ceah_people_id,
ac.c003 language_id,
ac.c004 proficiency,
ac.c049 modifiable_flag,
ac.c050 sql_action_typ
FROM apex_collections ac
WHERE ac.collection_name = 'DATA_COLLECTION'
ORDER BY ac.seq_id) x,
-- Error Collection
(SELECT ac.seq_id seq_id,
ac.c002 ceah_people_id,
ac.c003 language_id,
ac.c004 proficiency,
ac.c050 row_error -- Useful when individual data is correct, however the row of data is not. Ex: start/end dates
FROM apex_collections ac
WHERE ac.collection_name = 'ERROR_COLLECTION'
ORDER BY ac.seq_id) err
WHERE x.seq_id = err.seq_id(+)I got so frustrated I started over. I'm following the how to create a manual form.
http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
The problem I'm now having is even though I display items as hidden, there is a column holder on the report for them. If I go into the report attributes and toggle the show attribute off I cannot reference an items value in my logic. I used / / for the column heading but I still get the little sort arrow where the column heading should be. I tried to toggle the sort attribute off but the sort arrow still shows up. How can I use the apex_item.hidden and not get a place holder for the column on a report? Thanks, Elizabeth
Here is the code I'm using to generate the report:
select x.ceah_people_lang_id,
x.language_id,
x.proficiency,
x.ceah_people_id
from (
select apex_item.hidden(1,ceah_people_lang_id) ceah_people_lang_id,
apex_item.select_list_from_query(2,language_id,'select language_name, language_id from foreign_language') language_id,
apex_item.select_list_from_query(3,proficiency,'select name, id from proficiency') proficiency,
apex_item.hidden(4,ceah_people_id) ceah_people_id
from ceah_people_language where ceah_people_language.ceah_people_id = :P152_person_id
union all
select apex_item.hidden(1,null) ceah_people_lang_id,
apex_item.select_list_from_query(2,null,'select language_name, language_id from foreign_language') language_id,
apex_item.select_list_from_query(3,null,'select name, id from proficiency') proficiency,
apex_item.hidden(4,null) ceah_people_id
from dual) x -
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 -
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 -
Two Manual Tabular forms in a same page
Since i have to create two tabular forms in a same page, i created tabular forms manually.
Both the forms are working fine if the columns are not defined as conditional display.
Based on item value set by user, few fields should be either displayed as text field (editable) or read only (display).
I created two columns for a same field one as editable another one as non editable.
Based on item value any one of the column will be displayed.
Since the manual tabular form update process is using 'apex_application.g_f02', if any one of the column is not visible,
multiple row update is failing.
can any one please help me or suggest me to solve this.
Edited by: Ravi on Apr 19, 2012 9:02 AMI'm guessing you have a page item that is used to control display of the columns as display only or editable.
If that's true and the page item tells you to display the editable column, then you end up with say a g_f02 and a g_fo3, where you otherwise might only have a g_fo2.
Use the value of the page item in your update process to control which tabular form element to use. -
Hi friends,
I am new to Apex and am making a timesheet application. I have 2 main tables which I am using and their structures are as follows:
TB_OPMI_PROJ_ACT_MAP:
PROJ_REF VARCHAR2
REL_ID VARCHAR2
ACT_CODE VARCHAR2
TB_OPTI_EMP_TS:
PROJ_REF VARCHAR2
REL_ID VARCHAR2
EMP_ID VARCHAR2
ACT_CODE VARCHAR2
TS_WDI NUMBER
TS_WD2 NUMBER
TS_WD3 NUMBER
TS_WD4 NUMBER
TS_WD5 NUMBER
TS_WD6 NUMBER
TS_WD7 NUMBER
TS_REMARKS VARCHAR2
TS_STATUS VARCHAR2
Now I have to create a manual tabular form based on data from these 2 tables and either insert or update data into the timesheet table.
The page structure is such that I have created page items for emp_id, proj_ref and rel_id(all are LOV’s). And there is a button that submits the page. So when the user inputs the data and clicks on submit, the report whose source code is as follows shows up with data from both tables:
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
AND a.rel_id = b.rel_id
AND a.act_code = b.act_code
AND a.emp_id = '''||:P7_EMPLOYEE||'''
AND b.rel_id = '''||:P7_RELEASE_ID||'''
AND a.proj_ref = '''||:P7_PROJ_REF||''';';
ELSE
v_query := 'SELECT 1 FROM dual WHERE 1=0';
END IF;
return(v_query);
END;
Now this query is working fine. The data in the tb_opmi_proj_act_map is basically the activities mapped on each project reference and release id.
Now when there is no corresponding data for the emp_id,proj_ref,rel_id and act_code in the main timesheet table, even then I need to generate to a tabular form structure with all the activities listed for the input proj_ref and rel_id and the 8 respective columns for the days of the week and remarks for each row or activity. I don’t know how to progress and am stuck. I just had a thought of modifying my region source a bit something like this.
DECLARE
v_query varchar2(10000);
v_count number;
BEGIN
+Select count(*) into v_count from tb_opti_emp_ts where emp_id=P7_EMPLOYEE and proj_ref=P7 PROJREF and rel_id=P7_REL_ID;+
IF (:P7_RELEASE_ID is not null) and (v_count>0) 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
AND a.rel_id = b.rel_id
AND a.act_code = b.act_code
AND a.emp_id = '''||:P7_EMPLOYEE||'''
AND b.rel_id = '''||:P7_RELEASE_ID||'''
AND a.proj_ref = '''||:P7_PROJ_REF||''';';
ELSIF (:P7_RELEASE_ID is null) then
v_query := 'SELECT 1 FROM dual WHERE 1=0';
else
[code for generating my requirement in case the input is legit and there is no data in the timesheet table.]
END IF;
return(v_query);
END;
Please could someone help me????
Also in either case, whether data is generated from the join if already existing or if no data exists, I need to then insert the data or update it accordingly and have no idea how to proceed.
I know the solution will be a lengthy one but please its urgent and I am stuck. Please any help would be greatly appreciated.
Thanks in advance……Hi all,
In response to my previous post, I would like to update that I have been able to generate my required region.
Now the final query is as follows:
DECLARE
v_query varchar2(10000);
v_count number;
BEGIN
select count(*) into v_count from tb_opti_emp_ts where emp_id=:P7_EMPLOYEE and proj_ref=:P7_PROJ_REF and rel_id=:P7_RELEASE_ID;
IF ((:P7_RELEASE_ID is not null) and (v_count>0)) 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
AND a.rel_id = b.rel_id
AND a.emp_id = '''||:P7_EMPLOYEE||'''
AND b.rel_id = '''||:P7_RELEASE_ID||'''
AND a.proj_ref = '''||:P7_PROJ_REF||''';';
ELSIF (:P7_RELEASE_ID is null) then
v_query := 'SELECT 1 FROM dual WHERE 1=0';
else
v_query:='select (select act_desc from tb_opmi_act_code a where a.act_code=b.act_code) as activities,apex_item.text(1,null) Monday,apex_item.text(2,null) Tuesday,apex_item.text(3,null) Wednesday,apex_item.text(4,null) Thursday,apex_item.text(5,null) Friday,apex_item.text(6,null) Saturday,apex_item.text(7,null) Sunday,apex_item.text(8,null) Remarks from tb_opmi_proj_act_map b where proj_ref='''||:P7_PROJ_REF||''' and rel_id='''||:P7_RELEASE_ID||''';';
END IF;
return(v_query);
END;
Now I have created a button which have dynamic action as its on click action. Now in the dynamic action I have to write the code for inserting/updating the data in the timesheet table.
I need help with it please its urgent.......... -
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 -
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
------------------------------------------------------------------- -
How do I Create a Tabular Form for an Intersection Table
Situation
There are three tables involved (PROJECT, STAFF, TASK)
PROJECT(PROJECT_ID, PROJECT_NAME)
STAFF(STAFF_ID, STAFF_NAME)
TASK(PROJECT_ID, STAFF_ID, HOURS)
There is a many to many relationship between PROJECT and STAFF. The intersection table is TASK.
Issue
I would like to create a tabular form for the TASK table. I would like to be able to click on a button (Add Row) to add a row to the existing tabular form. The row will have a LOV for the PROJECT_ID (showing PROJECT_NAME) and one for the STAFF_ID (showing STAFF_NAME) and a free form text field for the hours.
I've tried a bunch of different ways but am unable to acheive this functionality. I must be doing something wrong. This sort of thing is trivial.
Any guidance/suggestions are greatly appreciated.
ThanksAdding a new surrogate key column to an existing table is not that big a deal.
alter table t add (pk int primary key);
create a before-insert row-level trigger to populate the key;Other than that, you are out of luck w.r.t the wizards. Yes, you can define a 2nd PK column in the wizard, but then the 2 PK columns becomes read-only (but you want to update them).
You can write your own tabular form using htmldb_item APIs and your own after submit processes to process the updates. See the manual Tabular Form Howto in the documentation.
Thanks -
Manual Tabular Form using checksum
I have a manual tabular form which updates OK but when I add the htmldb_item.mds_checksum it does not always work. It does not pass the MD5 checksum test in the update process. Sometimes it works some times it does not. No one else is updating this data so it should pass the checksum error.
I need a manual tabular form so I can to retrieve this same data in a collection if the page is submitted for a cascading dropdown in another region. That is correct?
Of course, I could do the cascading dropdown another way instead of select list on submit. This is puzzling me.
Here is the sql query:
select htmldb_item.hidden(1,sub_id) sub_id,
htmldb_item.display_and_save(2,column_id) column_id,
htmldb_item.display_and_save(3,column_name) column_name,
htmldb_item.display_and_save(4,primary_key) primary_key,
htmldb_item.display_and_save(5,required) required,
htmldb_item.select_list(6,isselected,'Yes;Y,No;N') isselected,
htmldb_item.md5_checksum(isselected) cks
from sub_columns
where sub_id = :P26_SUB_ID
order by 2
Here is the update process:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(isselected) cks
BULK COLLECT INTO
l_cks
from sub_columns
where sub_id = :P26_SUB_ID;
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.');
end if;
end loop;
-- update Subscription
for i in 1..htmldb_application.g_f01.count
loop
update sub_columns
set isselected = replace(htmldb_application.g_f06(i),'%'||'null%',NULL)
where sub_id = :P26_SUB_ID and
column_id = htmldb_application.g_f02(i);
end loop;
commit;
end;
Any help would be appreciated. I just don't see what I am doing wrong and I don't see any other way to do it.I had already read this paper before doing the tabular form manually. I tried to follow it as closely as I could. My tabular form is a little different since I have a where clause in my SQL and only updating one field. The other fields are display_and_save. And I was branching to a different page than the page containing the tabular form. I would think none of these differences should make it not work. I did change to branch to the same page. That made no difference.
I did not need to do an insert so I skipped doing that step and then went to Adding Optimistic Locking. It is failuring in my update process with this code:
-- Get original MD5 checksum
select wwv_flow_item.md5(isselected) cks
BULK COLLECT INTO
l_cks
from sub_columns
where sub_id = :P26_SUB_ID;
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.');
end if;
end loop;
I get the Error process message and then the above -20001 error message when I click on the Submit button. Is there something wrong with my above code? I would assume I would need to add the where clause to the above select since I am only updating whose records.
I had created a submit button with action submit page and redirect to URL. The process executes on the condition when the submit button is pressed.
I need to get this working soon. I would assume other people have done a similar thing. I have tried many things. Another thing I notice is if I tell it to not display the first column, sub_id, and the last column, cks, (unselecting display in Report Attributes section) then the update does not work. I must be doing something wrong but I don't know what.
I created the page with component, report, SQL Report, and region type SQL Query. -
Manual Tabular Form - Items not rendered
Hi,
i'm trying to build a manual tabular form:
I added a blnak page with a Report Region using a SQL Query in a Classic Report:
select apex_item.text(1,"EMPNO") as "EMPNO",
apex_item.text(2,"ENAME") as "ENAME",
apex_item.text(3,"JOB") as "JOB",
apex_item.text(4,"MGR") as "MGR",
apex_item.text(5,"HIREDATE") as "HIREDATE"
from "EMP" "EMP"The items are not rendered in the report, but the HTML Text is displayed instead.
See http://tinypic.com/r/2e6bqdu/5
I played around with "Display As" in the Column Attributes - no luck.
I used this links as reference:
http://apex.oracle.com/pls/otn/f?p=31517:170:2228543603318893:::::
http://www.oracle.com/technetwork/developer-tools/apex/tabular-form-090805.html (To build a tabular form manually:)
http://apexjscss.blogspot.com/2010/05/manual-tabular-form.html
Am i missing something ?
APEX 4.1 on 11gr2
regards,
gwThe "Display As" for each column should be "Standard Report Column".
Seems the default "Display as" for standard reports has changed:
I created your standard report in a 3.2 environment and the report defaulted the "Display As" for each column to "Standard Report Column".
I created your standard report in my own 4.0 environment and in the hosted apex.oracle.com environment and the report defaulted the "Display As" for each column to "Display as Text (escape special characters, does not save state)" -
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.
BenzI 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
------------------------------------------------------------------- -
Problem in saving BLOB on a manual tabular form
Hi All,
I have a manual tabular form which has one column as file browse (blob). When I browse and select some file to save with the row, it saves only the name of the file, not the actual file.
The example form is available on apex.oracle.com. The page has a process called SAVE which is supposed to save the record with blob.
Workspace: bobforum
user: forum
password: abc123
Application: 39196
Page: 1
I will appreciate if someone can help.
Thanks,
ZkayHi,
What I did check, apex_application.g_fnn array do not work for this.
From Google I did found that it has work in previous APEX version.
Something has changed and e.g. Denis example for multiple file browser do not work anymore.
http://htmldb.oracle.com/pls/otn/f?p=31517:161
I did manage upload files to wwv_flow_files table when using apex_application.g_xnn.
I did add derived column to report. To HTML expression I did place
<input type="file" name="x0#ROWNUM#" />
This way you could have report that shows max 20 rows in pagination page.
But I did not find way to identify file uploaded to flow files.
In After submit process apex_application.g_xnn seems have null value,
so I could not query wwv_flow_files by name column and insert file to my own table.
Regards,
Jari
Maybe you are looking for
-
Report Generation Toolkit Error Quick Question
Hi, I created the most awesome LabVIEW report ever at my desk using a trial version of the RGT and Office 2003. I took this to my production machine and ")@#(&%(*#^%()^!!!" The production machine has office 2007 and a fully licensed version of
-
My functions are not showing up on my screen
Hi I am not exactly sure how to describe this, I just installed cs6 and my functions are not showing up on my live preview. I have never seen anything like this before. here is my file, I have filled it in hot pink. This is how it shows up in the lay
-
I installed the newest software update from Apple last week and ever since then when I open an application, the icon doesn't appear in the Dock. It's becoming a problem because I have multiple programs running, which is slowing down my computer, but
-
How can I change the name of a PDF in the bookcase
How can I change the name of a PDF in the bookcase
-
How to create Base Dimensions with MaxL and Text File?
Hi, Doing a scratch rebuild of a cube every month. Don't want to have a 'dummy' outline with base dimensions to copy over every build. Instead want to build from text file somehow. Thus my plan is to: 1) Delete the existing app/db 2) Create a new bla