Customer Tabular Form Questions
I am following the white paper on creating a tabular form from scratch using Html DB ver. 1.6 and having trouble getting the report to show columns as fields. In 1.6 -- There is no 'create sql report (updateable) when you are creating the page. So I had to create the page as a SQL query, then go back and change the region definition type to "SQL query - updateable report, but the rows are still not updatable. What am I missing here?
Here is my SQL:
select
htmldb_item.hidden(1,T.EMP_ID_FK) EMP_ID,
T.HOUR_TYP,
T.SUN_HR,
T.MON_HR,
T.TUE_HR,
T.WED_HR,
T.THU_HR,
T.FRI_HR,
T.SAT_HR
from #OWNER#.HR_TIMESHEET T, #OWNER#.HR_EMPLOYEE E
WHERE T.EMP_ID_FK=E.EMP_ID AND
UPPER(E.Lname) = UPPER (SUBSTR(:APP_USER,2))
Also,
I am creating this page to capture the daily hours worked based on a value entered in a different region (week ending date) -- So week ending date is not part of the tabular form report region (which is just capturing the hours worked by day (M-Sun). When they submit, it should insert the hours by day and the week ending date in the same table.
Is it possible to do this with a tabular form (created from scratch?).
Thanks,
Jeffrey
The form that is using the tabular form has columns such as hour_type (OT, Regular, Sick) and then has columns for each day. The TAble has these columns as well as a week ending date. For one week ending date, their could be 3 or more rows:
example: 1 row for hours of OT by day
1 row for Regular hours by day
1 row for Vacation hours by day
I would like to have the week ending date in a different region (that also details the employees personal information) -- and the user would select the w/end date from a date picker within this region.
This also would help by letting the employee enter the w/end date and then he/she could see their hours for that w/end date.
Thanks,
Jeff
Similar Messages
-
Custom tabular form error on apex_item id larger than 50
First post :)
I'd like to share a potential bug in apex (3.0.1) or misconfiguration in our application server
When creating a page with a custom tabular form, i've noticed that when i give a column an id over 50 (ex: "apex_item.text(51,salary) salary")
the page will generate errors in the apache.
The apache error log states the parameter F51 as incoming but it contains no value.
Further allong the log states:
"VARIABLES IN FORM NOT IN PROCEDURE: F51"
example report query:
select apex_item.hidden(1,"ID")||apex_item.checkbox(2,"ID") delete_checkbox
,apex_item.text(3,name) name
,apex_item.text(51,salary) salary
from employee;
I've always been under the impression that we could use F01 till F99?
Is there anyone who has encountered this problem before, or are my conclusions wrong?
Looking forward to an answer!
NikoHi Niko and Roel
Roel, you are right, I am hitting the 50 columns only limit too. Do you know of any ways to overcome this limit?
This post also describes the problem: Re: column in tabular form
Currently I need to create a tabular form to edit a table with 84 columns.
It sounds ugly, but this is a spreadsheet and the requirement is to get it in Oracle Apex 'as it is' and still, be able to edit it using MRU.
Any ideas?
Thank you very much.
Kubilay
Edited by: Kubilay on Jun 15, 2009 10:29 AM
Edited by: Kublai-Khan on Jun 15, 2009 10:30 AM -
Java script is not working in custom tabular form
hai all,
i have changed my built in tabular form to custom tabular form.my java script is coding working fine in built in tabular form . But in my custom tabular form java script is not working ,since it is created as standard report(Display As).
pls help me.
with thanks and regards
sivakumar.GIs the appostrophe function test(pthis) *'* present in your javascript code...
If not can you post the same in apex.oracle.com and give the credential so that I can the why its not wroking
Regards,
Shijesh -
Custom tabular form for multi-row not saving data
Ok, before anyone asks, yes, I did read the how-to:-)
I have a custom tabular form, which I did cause I need to use popups and the popups that you can use in the wizard tabular form does not display the text but rather the value underneath it.
It returns data rather nicely and when I go and update values I can tell it is changing the fields underneath. I put a process in that will display the values in text fields on the form (for one row only) and I see them changing from what is already there and with the proper values.
However, when I do that the data that is displayed then gets reverted back to what it was previous to the update but reports that the process was successful.
I have also tried to insert but that is basically doing the same thing. Can anyone guide me.
SQL to generate the tablular form...
SELECT x.sak_release_db
, x.sak_object
, x.sak_release
, x.sak_participant
, x.sak_csr
FROM
(SELECT htmldb_item.hidden(1,sak_release_db) sak_release_db
, htmldb_item.popupkey_from_query(2, sak_object,
'SELECT b.nam_schema||''.''||a.nam_technical as table_name , b.sak_object
FROM system_object a
, database_table b
WHERE a.sak_object = b.sak_object') as sak_object
, htmldb_item.hidden(4,sak_release) sak_release
, htmldb_item.popupkey_from_query(5, sak_participant,
'SELECT nam_first || '' '' || nam_last as name, sak_participant FROM co_participant') sak_participant
, htmldb_item.popupkey_from_query(7, sak_csr,
'SELECT external_id|| ''-''||id_split as co, sak_csr FROM co') sak_csr
FROM release_db_xref
UNION ALL
SELECT htmldb_item.hidden(1,NULL) sak_release_db
, htmldb_item.popupkey_from_query(2, NULL,
'SELECT b.nam_schema||''.''||a.nam_technical as table_name , b.sak_object
FROM system_object a
, database_table b
WHERE a.sak_object = b.sak_object') as sak_object
, htmldb_item.hidden(4,NULL) sak_release
, htmldb_item.popupkey_from_query(5, NULL,
'SELECT nam_first || '' '' || nam_last as name, sak_participant FROM co_participant') sak_participant
, htmldb_item.popupkey_from_query(7, NULL,
'SELECT external_id|| ''-''||id_split as co, sak_csr FROM co') sak_csr
FROM dual) x
Process to verify that I have the correct global fields: (Type: PL/SQL anonymous block, Process Point: On Submit - After Computations and Validations)
begin
:P3_2 := replace(htmldb_application.g_f02(1),'%'||'null%',NULL);
:P3_5 := replace(htmldb_application.g_f05(1),'%'||'null%',NULL);
:P3_7 := replace(htmldb_application.g_f07(1),'%'||'null%',NULL);
end;
Process to do the insert/update. Note, I hardcoded the value in the where clause but I was originally using the global value for g_f01 (i also tried putting a commit in there for fun) (Type: PL/SQL anonymous block, Process Point: On Submit - After Computations and Validations):
-- Update the RELEASE_DB_XREF table
FOR i IN 1..htmldb_application.g_f01.count
LOOP
IF htmldb_application.g_f01(i) IS NOT NULL THEN
UPDATE release_db_xref
SET sak_object = replace(htmldb_application.g_f02(i),'%'||'null%',NULL)
, sak_participant = replace(htmldb_application.g_f05(i),'%'||'null%',NULL)
, sak_csr = replace(htmldb_application.g_f07(i),'%'||'null%',NULL)
WHERE sak_release_db = 22;
ELSE
IF htmldb_application.g_f02(i) IS NOT NULL THEN
INSERT INTO release_db_xref
(sak_object
,sak_release
,sak_participant
,sak_csr)
VALUES
(replace(htmldb_application.g_f02(i),'%'||'null%',NULL)
,htmldb_application.g_f04(i)
,replace(htmldb_application.g_f05(i),'%'||'null%',NULL)
,replace(htmldb_application.g_f07(i),'%'||'null%',NULL));
END IF;
END IF;
END LOOP;Florian,
Checkboxes are different from other HTML form items. When you have a text box for example, there's always a value send to the server when submitting. Even if that value is NULL. When you have a checkbox however, you only get the value if the checkbox is checked. It's not posted to the server when it is not checked. That's the general behavior of HTML forms and not specific to Oracle HTML DB.
When working with tabular forms in HTML DB, you can access your form values using the htmldb_application.g_f0x arrays. Now if you have for example 10 rows in your form, then you'll get ten elements in your array for text boxes, select lists, etc. For checkboxes however you'll only get as many elements as you have rows checked. If I read your update and insert code correctly, you're trying to use the checkbox arrays the same way you use the arrays based on other item types. My recommendation would be to use Yes/No select lists instead of checkboxes or at least use select lists initially to get it working and then work on properly processing the checkboxes.
Some general information about working with checkboxes in tabuar forms can be found here:
http://www.oracle.com/technology/products/database/htmldb/howtos/checkbox.html#CHECKBOX_IN_REPORT
Hope this helps,
Marc -
Custom Tabular form - Session state values disappear
Hi,
I have a custom tabular form page using apex_item and apex_collections. I am using the apex_collection to store the values in memory in order to avoid the data loss in session state. The page is working fine after a validation failure and it shows the values on the second report (as advised for custom tabular forms).
In this, some of the rows have clob value which needs to be edit on a rich text editor. Since apex_item does not provide a solution to have rich text editor, I have to branch to another page on an Edit link for the CLOB data using a modal window. However When I return back from the modal page, the values disappear from session state, and the validation (using htmldb_application.g_fxx arrays) does not take place.
Is there any workaround to overcome this issue?
Apex version: 4.1
Thanks in advance.
NatarajanThanks Daniel for your reply.
Actually its an interface with a custom tabular form on page 1 with apex collections and rich text editor on page 2. Since it is not possible to have the rich text editor, I need to have it in another page (I could have it the same page, that is the way I am trying now) however I open the next page as a modal window.
I have a link on the tabular form, so that the clob content is opened in the rich text editor on the next page. After the edit, I update it to the same collection and go back to the tabular form page and refreshes the report. It works fine, but causes trouble to the data entered on the other columns in the custom tabular form.
I have now deviated to another work and put this on a hold. If my explanation is still not clear, I will create the same page in apex.com to simulate the error.
Thanks again.
Natarajan
Edited by: Nattu on Mar 14, 2012 11:35 PM -
Custom Tabular Form addRow function
Hi All
There appears to be a lot of people discussing this on the forum, but so far, I haven't been able to find a solution.
I have a custom tabular form and I need to add and Add Row button to create multiple blank rows without submitting the page. I have previously used a solution devised by Duncs many moons ago, that basically clones a row.
http://djmein.blogspot.co.uk/2007/12/add-delete-row-from-sql-based-tabular.html
Unfortunately, this basic method doesnt work for popup_lov apex items, nor will it increment ID numbers.
Ideally I would like to be able to use the addRow function that is used for a Tabular Form built using the Wizards; however, that function uses a ghost row as described in this forum thread:
"Ghost row" in 4.0 Tabular forms has id pattern f0x_0000
If it were possible to replicate that ghost row in a custom tabular form, then I guess that it would be possible to use the apex addRow function out of the box!?
Before I start re-inventing the wheel, has anone aready done this, or can you point me in the right direction please.
I hope that makes sense :)
Shunt
I'm using Apex 4.02 11g and will be upgrading to 4.2 in the near future; woohoo.Thanks Daniel for your reply.
Actually its an interface with a custom tabular form on page 1 with apex collections and rich text editor on page 2. Since it is not possible to have the rich text editor, I need to have it in another page (I could have it the same page, that is the way I am trying now) however I open the next page as a modal window.
I have a link on the tabular form, so that the clob content is opened in the rich text editor on the next page. After the edit, I update it to the same collection and go back to the tabular form page and refreshes the report. It works fine, but causes trouble to the data entered on the other columns in the custom tabular form.
I have now deviated to another work and put this on a hold. If my explanation is still not clear, I will create the same page in apex.com to simulate the error.
Thanks again.
Natarajan
Edited by: Nattu on Mar 14, 2012 11:35 PM -
Manually tabular form question
hi all
i built a manually tabular form.
i want that this tabular for will used only to update , and without the option of insert new row .
two questions i have here according to the document :
there is something called
Adding Optimistic Lockingoptimistic locking
is that possible to do it if it's only an update form?
i've tried to do it and not really succeeded.
second question is about collection
again is this possible to do it if i built only an update form ?
thanks for quick responseHi Naama,
>> i've created the package , it's show like it done but then i cannot see it.what seems to be the problem ?
I have no idea, but this is definitely something local in your database. Just drop the package and re-create it. If the Object Browser doesn’t show you the package, try to use SQL*Plus.
>> what is the meaning of this package?
is this package active only in the tabular manually form ?.
This is a regular PL/SQL package, and with the proper privileges, can be used anywhere on the database, with or without APEX connection.
This package is “special” because it’s includes all you need to manage Optimistic Locking, which is characteristic to Web based applications. Other than that, you can use it whenever you need to manipulate the related table(s).
>> the apex know in which part to relate in the package right ?
APEX don’t know anything. When you are building a manual tabular form, it is also your responsibility to construct the proper DML processes. If you want your tabular form to support insert/update/delete you’ll need to construct three processes, each with the proper DML statement, each condition by the proper button. In your private case, as you need to support update only, you’ll need to build only one DML process (PL/SQL anonymous block), which will call the proper update procedure from the package.
>> thank you
Naama
Wow! You signed your name correctly :) You should amend your handle to reflect that.
Best Regards,
Arie. -
Dynamic Action On change tabular form question
Hi guys!
I've wanted to add dynamic action on change (tabular form) to execute PL/SQL which checks if column of the tabular form has changed and if yes it changes walue of text field to Y or N. It doesnt work...and I don't know why. If I create validation with this PL/SQL it works. Can you help?
DA:
On change - Tabular Form
PL/SQL;
DECLARE
nazwa VARCHAR2(4000);
counter NUMBER := 0;
BEGIN
FOR i IN 1 .. apex_application.g_f08.COUNT
LOOP
SELECT NAZWISKO INTO nazwa FROM SPR_META.M_UZYTKOWNICY WHERE NAZWA_UZYTKOWNIKA = apex_application.g_f02(i);
IF wwv_flow_item.md5(nazwa) <> wwv_flow_item.md5(apex_application.g_f08(i)) THEN
counter := counter + 1;
END IF;
END LOOP;
IF counter > 0 THEN
:P5_IS_TABULAR_FORM_CHANGED := 'Y';
ELSE
:P5_IS_TABULAR_FORM_CHANGED := 'N';
END IF;
END;Page items to submit: P5_IS_TABULAR_FORM_CHANGE
What's wrong?
With regards,
PsmakRRegion static id shouldn be in bracketsYou missed the '#' informt of the region id.
why my original PL/SQL process did not work
FOR i IN 1 .. apex_application.g_f08.COUNTThis works only when the application array has values and that happens only when the page is submitted.When you submit the dynamic action , it isn't.
This script combined with script to detect changes makes apex page running very slowIf you use that PLSQL code(assuming it works as expected) , then its going to take a server request every-time you change a field in the tabular form and loop though all the array values(if they would be submitted before) and recalculate and compare the checksums . Isn't that going to be very inefficient.
As for that JS code, it only runs at the client side. You can do all the server side checks on submit, when the user expects some delay due to processing. -
Custom Tabular Form with working days by quarter
Hi All, I'm trying to create an application to improve an old excel that some people use in my office. I came across a challenge: create a page when a user can submit for each business day the amount of hours worked, the real problem is that I have to show on the same page 40 business days that need to be dynamic, I mean that there is a "period" table that has a start date and end date, the range between those two MINUS the Saturdays and Sundays should be the amount of COLUMNS that the report show.
create table CT_PERIOD(
PERIOD_ID VARCHAR2(6),
PERIOD_FY VARCHAR2(4),
PERIOD_QUARTER VARCHAR2(1),
PERIOD_START_DATE DATE,
PERIOD_END_DATE DATE,
PERIOD_DAY_COUNT NUMBER,
insert into ct_period values ('1', 'FY14', 'Q1', to_date('01-JUN-2013', 'DD-MON-YYYY'), to_date('25-AUG-2013', 'DD-MON-YYYY'), 56);
commit;
I searched in the web for some example of this with no luck, if somebody did something like this or knows where I can see an example that would be great!
Thanks!Hi guys,
I'm having exactly the same problem, I need a tabular form with days as columns to add actual working hours for each day as for each row ( task) -
How can I immediately use an automatically generated PK which is created when I add new row to a tabular form and then click on the Submit button?
This is best accomplished with a trigger. The database takes care of it and APEX can take advantage of it.
This type of trigger would be known as an AFTER INSERT trigger that would be placed on table A. The body of the trigger would look something like this:
begin
new_val number;
if (:new.id is null) then
select table_a_sequence.nextval into new_val from dual;
:new.id := new_val;
end if;
insert into table_b (fk_to_table_a_id)
values (new_val);
end;Caution: this is untested code for demonstration only. Adjust for your purpose.
Earl -
This should be a simple one. I have a tabular form right now but I have a field in that form I want read only when another field in the record is not null (ie. you are not adding a new record). Any ideas here? For the record were running APEX 3.1.2.
I got to doing some digging after I posted this and I found some interesting stuff using javascript but because of DB Links I kept running into db consistency errors (where apex complains constantly that there the database version had changed since you started the action). In the end I abandoned tabular forms entirely because I have always ended up with them in the same position of the database version constantly changing and they end up un-usable. What I would love to see and would really help me out the most once 4.0 comes would be for APEX to support automatic operations over a dblink without the need for local views or having to write a plsql interface package for the remote tables so I can use forms over procedures.
-
Row selector in tabular form question
hi all,
i needed to use the tabular form for the report because i needed the row selector. i have around a 100 records on this. but each page shows only 15 rows which is fine. the problem i'm having is that if i wanted to select more than 1 record and these records are located on different pages of the report, how do i set the report to remember all the records i've selected?
i noticed that for example, page 1 shows records 1 - 15 then i checked record 1, then move to the next page for records 16 - 30. here i select record 20. then when i do a transaction, only record 30 is processed and record 1 is disregarded.
can anyone help me with this?
thanks
allenHi,
You should perhaps use collections. Collections are session based and can be used in a similar way as having a temp table and what you could do is store your data within the collection and then save the "selections" you made to the collection which would make your tabular form remember what you have seelected and therefore you could retrieve 1- 10 rows and then paginate to the next 10 rows. -
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 -
Hi,
I have created a tabular form on 2 tables by using a view. Unfortunately when I submit the changes I get the following error.
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01779: cannot modify a column which maps to a non key-preserved table, update "PROJECT2"."TASK_MILESTONES" set "TID" = :b1, "MS_ID" = :b2, "CAT_ID" = :b3, "NAME" = :b4, "DESCRIPTION" = :b5 where "TID" = :p_pk_col
Any suggestions on how to get around this?
TomYou will need to combine the following:
1. Crosstab Query. This blog has an excellent article on CrossTab or Pivot queries:
http://thinkoracle.blogspot.com/2005/09/pivot-and-crosstab-queries.html
The limitation with this method is you will need to fix the maximum number of actions that there are for any given case. Alternatively you could use plsql to return the report sql by first looping through the actions to find the maximum number.
2. Custom Tabular Form. You will quickly find that there a limitations with the wizard generated tabular forms. Custom forms built using the apex_item APIs will give you much more control. This how-to is a useful guide for getting started.
http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html
If you need more explanation on any of these or help writing the code, please let us know.
Cheers
Shunt -
Custom popup from tabular form
Hi,
I would like to create a custom popup in a tabular form.
The standard popup doesn't realy satisfy my needs.
I followed the "How to" to create a custom popup, so that method is known. And this is working for a part.
I managed to alter the tabular form so that it calls the Javascript to get the popup window by entering :
<INPUT TYPE="TEXT" VALUE="#PROJ_ID#"> Click for LOV
in the HTML Expression of the column format section.
So the popup window is opened correctly, but the problem is how to return the selected value to the text item in the tabular form.
Returning a value to a normal text item is no problem, but it is to return it to a cell in an tabular form.
I tried to enter the following in the Passback Javascript:
opener.document.getElementById("F04").value = passVal2;
But this doesn't work correct and also is not flexible since F04 is the cell for only that row.
So the question is: How can I write my Javascripts Passback function so that it returns the passVal2 value to the right cell of the tabular form?
Any ideas?
Regards GuidoNobody has ever done such thing?
Isn't there a way to address a specific cell in a tabular form?
Maybe then I have to look for another solution:
What I would like is, when selecting something from the popup (in the tabular form) a second column (The description column)has to be filled in with a value looked up from the selected popup value. This is just a default value,this "Description" field must be a text field so that users can change the description before "saving" the record to the table.
So anybody has an idea how this can be implemented?
Thanks for your help in advance!
Guido
Maybe you are looking for
-
My home page opens in the initial FireFox window, but new tabs open with a blank page. To get to my default page I have to click "home", but now it's way over on the other side of the page. Can I set a default for new tabs?
-
Hi I am supporting a set of web pages which display data to the user based on XML transformed by a set of style sheets. Currently when the user does something and fires the doPost method we get the "File Download" box appear with the message "Some fi
-
The touchpad is uneffective when my macbook pro retina (2013) is connected on TV via HDMI. Why?
-
Non-Blocking Multicast Sockets in JDK 1.4?
Hi, I've been trying to create non-blocking multicast sockets in JDK1.4, which essentially seems (at this stage) to boil down to the simpler problem of creating a DatagramChannel that uses MulticastSockets, or at least DatagramSockets that can join a
-
when i sync with itunes, the contacts etc sync, but no music. I have tried the restore option and it still will not sync my music. Please help, as this is a major problem.