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
Robert
Hi,
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
Similar Messages
-
Hello all,
Using APEX 4.1 on Oracle 11.2 SE (Oracle Linux Server release 6).
I have a Page with a region based on a Tabular Form.
The Region Source query has various columns, including an ID. I have also added a DATE column and a "Button" column which appear on every row.
The extra DATE field is displayed as a Select List on a Named LOV.
The extra Button field is displayed as a standard report column, and has Column Link attributes which cause it to branch to another page when pressed.
What I want to happen is that when the user presses the button on one of the rows, APEX sets two application items before going to the new page:
1. the ID column for the row in which the button was pressed
2. the value currently highlighted in the Select List, for the row in which the button was pressed
Using a Column Link item value of #ID# I can successfully get hold of the ID column for the correct row.
But doing the same for the Select List column invariably returns the default value of the Select List (i.e. the initially-selected value). It doesn't pick up the change if the user has gone into the Select List and chosen a different value.
Can anybody advise the easiest way to acquire the selected value in a Select List in a Tabular Form?Thanks for the reply!
To get this working I did the following:
1. Used APEX_ITEM.SELECT_LIST_FROM_LOV(... p_item_id=>'LOVI_'||TO_CHAR(id) ...) in the base query, to generate the LOV. (Note: the ID column is the primary key, so no need to use a ROWNUM column)
2. Added a Standard Report Column with the following settings:
Link Text = <img ... >
Link Attributes = Empty
Target = URL
URL = javascript:window.location.href = 'f?p=&APP_ID.:123:&SESSION.::::ID,SELECTED_STRING:#ID#,'+$v('LOVI_'+'#ID#');
So when the link is pressed, the JavaScript is invoked and it evaluates to the value currently present in the uniquely-named <select> item.
Ian -
Cascading select list in a tabular form -plz help me out
hello,
how can i implement cascading select list for filtering my tabular form report results.
Like i want to have the cascading select list's above the tabualr form report such that when i select the value in one select list, this should populate the values in other select list box(like one select list is dependent on other select list) and try to click a button say refresh, my tabular form report should be refreshed and should filter the report based on the select list value.
i want to have three select list items above my report - and these select list are dependent on one other - tats why i want to make them cascading select list.
can anyone provide me with an example of the cascading select list.
can anyone help me out with cascading select list.
thanks.Aplication item is always hidden - Shared Components > Application Items. You can create only one item and that would also be enough. For transparency purposes I said to create two. However, one will do the job.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
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.......... -
Problem in tabular form based on dynamic view and pagination
Hi All,
I have a manual tabular form based on a dynamic view. The view fetches the records based on search criteria given by the user in all cases. But this view fetches ALL records when user clicks on pagination, without considering the search criteria. This is the problem I am facing.
I am doing the following:
Since tabular form does not support pl/sql function returning query, I cannot use a table directly. I need my results based on search criteria selected by user. Hence I created a dynamic view and used a "INSTEAD OF UPDATE" trigger to update the table.
I use a set bind variables procedure, on load before header for setting the variables.
This view fetches the correct data based on user search always. It creates a problem only in one situation, when using pagination in the report.
The example can be found at:
http://apex.oracle.com/pls/otn/f?p=19399:1:
username = [email protected]
pwd = kishore
Here if "manager name" is entered as test, we get 5 records in "Summary of requests" report and 5 records in "Inactive Requests" report. When user clicks on Pagination in any of the reports, ALL the 7 records get fetched in "Summary of Requests" and 6 records in "Inactive Requests". How can I overcome this problem?? The report must consider the search variables even when pagination occurs.
Is this because, the inbuilt "html_PPR_Report_Page" executes the region query once again by considering all search variables as NULL?
Backend Code is at:
http://apex.oracle.com/pls/otn/
workspace: sekhar.nooney
Username :[email protected]
pwd: kishore
application id = 19399
My region code is something like:
select *
from regadm_request_v
where access_type = :F110_REGADM
and status <> 'INACTIVE'
order by request_id
My view code is:
CREATE OR REPLACE VIEW REGADM_REQUEST_V
AS
SELECT *
FROM REGREGOWNER.REGADM_REQUEST
WHERE upper(employee_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_NAME),'%')||'%'
AND upper(manager_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_NAME),'%')||'%'
AND upper(employee_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_SUNET_ID),'%')||'%'
AND upper(manager_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_SUNET_ID),'%')||'%'
AND upper(request_date) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_REQUEST_DATE),'%')||'%'
AND upper(USAGE_AGREEMENT_RECVD) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD,'~!@',NULL,REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD)),'%')||'%'
AND upper(STATUS) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_STATUS,'~!@',NULL,REGADM_REQUEST_PKG.GET_STATUS)),'%')||'%'
AND upper(REQUEST_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_REQUEST_APPROVED,'~!@',NULL,REGADM_REQUEST_PKG.GET_REQUEST_APPROVED)),'%')||'%'
AND upper(nvl(APPROVAL_DATE,sysdate)) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_APPROVED_DATE),'%')||'%'
AND upper(APRVL_REQUEST_SENT) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS,'~!@',NULL,REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS)),'%')||'%'
AND upper(NOTIFY_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION,'~!@',NULL,REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION)),'%')||'%'
I would be glad for any suggestions.
Andy/Varad any ideas? You both helped me a lot on my problems for the same application that I had faced before in More Problems in Tabular form - Please give me suggestions.
Thanks,
SumanaHi Andy,
The view and the package for setting bind variables work properly in my entire application other than the pagination. A pity that I came across this only now :(
I have used this same method for holding variables in another application before, where I needed to print to PDF. I used this approach in the other application because my queries were not within the APEX character limit specified for the "SQL Query of Report Query shared component".
In this application, I initially had to fetch values from 2 tables and update the 2 tables. Updateable form works only with one table right? Hence I had created a view. Later the design got changed to include search and instead of changing the application design I just changed the view then. Still later, my clients merged the 2 tables. Once again I had just changed my view.
Now, I wanted to know if any method was available for the pagination issue (using the view itself). Hence I posted this.
But as you suggested, I think it is better to change the page design quickly (as it would be much easier).
If I change the region query to use the table and the APEX bind parameters in the where clause as:
SELECT *
FROM REGADM_REQUEST
WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
I also changed the ApplyMRU to refer to the table.
Here the pagination issue is resolved. But here the "last Update By" and "Last Update Date" columns do not get updated with "SYSDATE" and "v(APP_USER)" values, when update takes place. Even if I make the columns as readonly text field, I am not sure how I can ensure that SYSDATE and v('APP_uSER') can be passed to the columns. Any way I can ensure this? Please have a look at the issue here: http://apex.oracle.com/pls/otn/f?p=19399:1:
I have currently resolved the "last update" column issue by modifying my view as:
CREATE OR REPLACE VIEW REGADM_REQUEST_V
AS
SELECT *
FROM REGADM_REQUEST
I modified my region query to use APEX bind parameters itself as:
SELECT *
FROM REGADM_REQUEST_V
WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
And I use the "INSTEAD OF UPDATE" trigger that I had initially written for update. The code is:
CREATE OR REPLACE TRIGGER REGADM_REQUEST_UPD_TRG
INSTEAD OF UPDATE
ON REGADM_REQUEST_V
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
UPDATE REGREGOWNER.REGADM_REQUEST
SET MANAGER_EMAIL = :NEW.MANAGER_EMAIL
, EMPLOYEE_EMAIL = :NEW.EMPLOYEE_EMAIL
, STATUS_UPDATE_DATETIME = SYSDATE
, USER_UPDATE_ID = (SELECT v('APP_USER') FROM DUAL)
WHERE REQUEST_ID = :OLD.REQUEST_ID;
END;
Please let me know how I can resolve the "last update" column issue using the table itself. (Just for my learning)
Thanks,
Sumana -
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 :) -
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 -
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 -
Question about manual tabular forms
Hello. I have a manual tabular form which has a some select_list_from_query items, text_from_lov_query, hidden, etc. I have not found a way to have one of the select lists based on one of the hidden items. Is it possible for the select list query to use other items from the form's select statement? In the code sample below I would like group_number to be based on the board_group_type_id.
Thank you,
-Carmine
select
htmldb_item.hidden(4,board_group_type_id) board_group_type_id,
htmldb_item.select_list_from_query(7,group_number,
'select m.valid_group_number d, m.valid_group_number r
from board_group_type b, map_group_numbers m
where b.board_group_type_id = m.board_group_type_id
and b.board_group_type_id = '|| TO_CHAR(board_group_type_id) ||
' order by 1',
NULL,'NO') group_number
from board_groups
where system_id = :P0_PROFILE_NAMEBump...Anyone?
Thank you,
-Carmine -
Select item on a Tabular form with a different dynamic LOV on each row
I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
-- JustinI'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
Here's the query:
select apex_item.display_and_save(1,dept) dept,
apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
from dept_emp
I removed the code that was there already (ApplyMRU) and just put in this code:
BEGIN
FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
UPDATE dept_emp
SET
name=HTMLDB_APPLICATION.G_F02(i)
WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
END LOOP;
END;
The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
The thing I could not get to work was a dynamic message
#MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
Thanks again everybody! -
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
------------------------------------------------------------------- -
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 -
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 -
I have a couple of problems with the manual tabular form I have created and would appreciate some help,
First the htmldb_item.popup_from_query is not populating the field when I select the item:
The query looks something like this:
Select x.data1,
x.data2,
x.data3,
x.CKS
From (
Select htmldb_item.display_and_save(1, data1) data1,
htmldb_item.text(3, data2, 50) data2,
htmldb_item.select_list(4,data3,'Yes;Y,No;N') data3
htmldb_item.md5_checksum(data1,data2, data3) CKS
FROM my_table
UNION ALL
Select htmldb_item.popup_from_query(1, NULL, 'select code || CHR(45) || description descrip, code from PRODUCT_STREAM', 2, 2) data1,
htmldb_item.text(3, NULL, 50) data2,
htmldb_item.select_list(4,'N','Yes;Y,No;N')data3,
htmldb_item.md5_checksum(null,null,null) CKS
FROM dual
) x;
When this page is run, the existing data is displayed with a blank line at the bottom as expected, it I click on the popup icon a list of codes is displayed, but I cannot click on any of the items to populate the data1 field. If I change the query on the top of the union so the first data1 is also htmldb_item.popup_from_query then it works fine, but data1 cannot (user requirement) be changed by the user, how can I fix this so the popup list works.
Second thing:
CKS is showing as another column in the tab form, if I uncheck show it doesnât work anymore, there us no data showing in the column just the heading, and I can get rid of the text but there is still allocated size for it.Why do you have to write the tabular form manually? Why not use the tabular wizard and have the form, including checksums, generated for you? In HTML DB 1.6 you can include options to automatically add new empty rows to your tabular form and have a row selector with delete functionality.
Neither the manual tabular forms nor the automatically generated tabular forms support mixing display types for columns. Having a display-and-save display type for existing rows and a popup for new rows doesnât work. All rows, including new ones, have to use the same display type to work properly. If itâs a requirement to have this data1 column be read-only for existing rows, then you need to create a separate form for adding new rows. So e.g. you could have a tabular form only for existing data and an add-row button that takes the user to a data entry form on another page.
Youâre checksum btw shows up in itâs own column because you defined it to be an extra column in your SQL statement. Since itâs just rendering a hidden form field, you could append the checksum to another column:
htmldb_item.select_list(4,'N','Yes;Y,No;N') ||
htmldb_item.md5_checksum(null,null,null) data3
When using manual tabular forms, the column alias names are irrelevant. But again, Iâd recommend using the built-in functionality.
Regards,
Marc -
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.
Maybe you are looking for
-
Cannot open new tabs in same window since FF update to version 15.0
This morning, FF updated to version 15.0 when I opened it. Now, All links open in new windows instead of tabs like I have it set to do (yes, I've already checked). Also, I tried to go to about:config and NOTHING HAPPENS. The address bar is not workin
-
Adobe .dng files do not show as Thumbnails in Finder
I've recently downloaded some Adobe .dng (raw image files) from their site as part of a Lightroom tutorial, but I find that they do not show up in Finder as thumbnails. They all just show the same icon, (which looks like a camera aperture), and this
-
Better way of Sending E-Mail Notifications -- Workflow or Function Module ?
Hi All, I have an implicit enhancement written in a t-code and based on some conditions I am creating event which inturn will trigger the workflow which inturn send e-mail notification via send mail step. My question is: Which one of the ways is bett
-
Can't get past "Setup Profile" for registration
I'm trying to register for My Verizon, but I can't get past the "Setup Profile" page in order to register. The "Continue" button on the bottom right will not allow me to click it. What's up?
-
I was cleaning up some workstations from my inventory db using the InventoryRemovalList.txt. It worked well except for 2 workstations that are not being removed. I'm exporting the workstations from the inventory db in C1 and copy/pasting to the Inven