Read interactive report checkbox on submit
NEWBIE QUESTION: How can you determine which row's checkbox in an interactive report is checked on a button submit process?
Hi,
This post might help
Re: Need help with APEX_Collection
Use Ajax to store checked rows to collection
Regards,
Jari
Similar Messages
-
Dynamic Checkboxes on Interactive Report
I have an interactive report that currently lists a row of values:
Field1
Val1
Val2
Val3
I would like to place a text-field at the top of this interactive report with a submit button:
[textbox] [submit button]
Field 1
Val1
Val2
Va3
Then I would like to have checkboxes [] appear in each row:
[textbox] [submit button]
Field1 | Checkbox
Val1 | []
Val2 | []
Val3 | []
Then I would like to make it so that the user enters some text into the textbox and selects any number of the row checkboxes. Upon hitting submit, a procedure will run that accepts each Field1 value and inserts a record into a table containing 2 fields: the Field1 value and the textbox text.
So the following user input:
[Test text in the textbox.] [submit button]
Field1 | Checkbox
Val1 | []
Val2 | [x]
Va3 | [x]
After hitting the submit button, a procedure would be called that would insert 2 records into a table:
Field1 | Field2
Val2 | Test text in the textbox.
Val3 | Test text in the textbox.
Note that there is no entry for Val1 because its checkbox was not checked when the user pressed submit.
What can I do to make this happen? I appreciate any help you can offer.Thanks for sharing
I am having exactly the same problem.
I have an interactive report with the following SQL.
select RSN_CD,
DESC,
APEX_ITEM.CHECKBOX(1,RSN_CD) "Select"
from CAN_RSN
I've set the 'Select' column's type to 'Standard Report Column'. But the checkbox does not appear on the report.
Apex Version: 4.0.1.00.03
Thanks. -
Tabular form validation(Checkbox) is not working for Interactive report
Hi,
I am using the oracle apex 4.0 and oracle 11g.
I have written a below select query on interactive report as
select
apex_item.checkbox(1,RESIDD)||apex_item.hidden(2,RESIDD) row_selector,
apex_item.text(3,RESNUM) as resnum
from "PDRRES"
and written the validation to display the error message( Function returning error text ) as
DECLARE
vRow BINARY_INTEGER;
BEGIN
-- apex_application.g_print_success_message := NULL;
FOR i IN 1 .. apex_application.g_f01.COUNT
LOOP
vRow := apex_application.g_f01(i);
apex_application.g_print_success_message := apex_application.g_f01(i)||'-'|| apex_application.g_f03(vRow) ;
END LOOP;
END;
Output : No data found error message
As far as it work for sql report with above logic because apex built in row selector
but it fails in case of interactive report for some reason.
Please suggest.Saroj Nayak wrote:
Hi,
I am using the oracle apex 4.0 and oracle 11g.
I have written a below select query on interactive report as
select
apex_item.checkbox(1,RESIDD)||apex_item.hidden(2,RESIDD) row_selector,
apex_item.text(3,RESNUM) as resnum
from "PDRRES"
and written the validation to display the error message( Function returning error text ) as
DECLARE
vRow BINARY_INTEGER;
BEGIN
-- apex_application.g_print_success_message := NULL;
FOR i IN 1 .. apex_application.g_f01.COUNT
LOOP
vRow := apex_application.g_f01(i);
apex_application.g_print_success_message := apex_application.g_f01(i)||'-'|| apex_application.g_f03(vRow) ;
END LOOP;
END;
Output : No data found error message
As far as it work for sql report with above logic because apex built in row selector
but it fails in case of interactive report for some reason.
Please suggest.NO DATA FOUND usually occurs when an i mplicit select does not find anything. It can also occur when referencing a collection element that has not been defined.
You have 2 collectinons in the code you posted, apex_application.g_f01() and apex_applciation.g_f03. Since you are looping therough the COUNT attribute of g_f01 its reference ("I") is probably okay and the value store in vRow is probably not right. You can check this by using RAISE_APPLICTION_ERROR to see the value something like
raise_application_error(-20000,'vRow="'||vRo2||'"');Remember that working with checkboxes is tricky. If the box is not checked nothing will be sent. You may need to define a default value when no value is submitted. -
Selecting the Checkboxes on Interactive Report
Hello
I have two checkboxes on a Interactive Report:
My query is as follows:
select
apex_item.checkbox(1, empno, 'ENABLED'),
apex_item.checkbox(2, deptno, 'ENABLED'),
ename,
sal
from emp;
I have a conditional button 'Check N Update' which will invoke the Pl/SQL process:
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
l_empno := APEX_APPLICATION.G_F01(i);
UPDATE XXX ....;
END LOOP;
FOR i in 1..APEX_APPLICATION.G_F02.count
LOOP
l_empno := APEX_APPLICATION.G_F02(i);
UPDATE XXX ....;
END LOOP;
What I need is I need to check a CONDITION, if BOTH the checkbox's are selected then I need to throw an ERROR saying.
YOU CANNOT SELECT BOTH the boxes.
Please let me know how can I get this.
Appreciate your help.
thanksHi
Using a RadioGroup would actually create one radio button for each line and mean that you could only select one line.
As the submit process will only return the boxes that have been checked, you only have access to the ticked items and as these contain just the EMPNO and DEPTNO values, you have no way to check if any two are from the same row.
This means that you will have to rethink your report slightly. You will need to have two checkboxes with ROWNUM as the value (if the report is sorted somehow, this may make this more awkward as ROWNUM is from the unsorted data) and make your EMPNO and DEPTNO hidden fields. The when the user submits the page, you will have to compare the ROWNUM values for the first column with all the ROWNUM values for the second column to see if there's a match.
As an alternative, you could have a select list for the first item and give the user options for EMPNO, DEPTNO, Both, Neither?
Andy -
Interactive report with checkbox and editable field
Hi,
For a project I'm working on I need to create a interactive report in Apex 3.2 with the ability to select lines and to modify one of the columns in the report.
To do this, I started off by adding these two fields to the selection query of my IR:
apex_item.checkbox(1, product_number) cb
and
apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER
cb is the checkbox files, and QTY_TO_ORDER is the editable field.
That worked like a charm and I got my two fields in the report.
To process the values, I added this page process, wich for now should only store the "product number" and "QTY_TO_ORDER" fields in a table.
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i));
END LOOP;
commit;
end;
However, this doesn’t work the way I want it to work. When I check the checkboxes of two rows, it will store two rows with the right product numbers, but it will take the top two QTY_TO_ORDER field of the table regardless of which ones are checked. I was able to solve this problem, by adding a rownum to the query and using the rownum as the value for the checkbox. Since I still need the product_number and qty_to order fields I made them both text fields.
I changed my page process to:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
insert into mytmptable values (APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(i)),
APEX_APPLICATION.G_F03(APEX_APPLICATION.G_F01(i)));
END LOOP;
commit;
end;
This seemed to solve the problem, and I now got the right values in the table, unless I used sorting in the report... As soon as I sorted the report in a way different than by rownum, I got the wrong values in the table. The reason for this is of course that my insert just selects the nTh row from the table, and my rownums aren't dynamic.
I've found a lot of examples on the internet using '#ROWNUM#' in the selection, which should dynamically generate a rownum in the report. This seems to work in normal report, but in a interactive reports, the literal values '#ROWNUM#' shows up.
Is there any way to solve this issue?Hi,
Try with 3 fields:
apex_item.checkbox(1, product_number) cb,
apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER,
apex_item.hidden(3, product_number) prod_no
The hidden field should be display as a hidden column.
Then your process can be:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
FOR j in 1..APEX_APPLICATION.G_F03.count LOOP
IF APEX_APPLICATION.G_F01(i) = APEX_APPLICATION.G_F03(j)) THEN
insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(j));
exit;
END IF;
END LOOP;
END LOOP; -
Setting Value of apex_item.checkbox in interactive report
Forum
We need a "select all" and "unselect all" functionality in an interactive report ...
The IR Query currently goes something like this :
select
OBJ_LABEL",
"DATA_START_DATE",
"S_ROWSTATE",
"S_ROWVERSION",
APEX_ITEM.CHECKBOX(1,item_id, 'Checked') "Select"
from some_table;
We have the checkbox selected by default .... the question now is how to have an "unselect all" and "select all" function or heading in the Interactive Report that would unset or set the checkboxes for all rows in the report.
Any advice will be helpful ....
Thanks
PierreAnswering our own question :-)
1) Add an unselect and select button and a hidden field
2) modify the query to use the value of the hidden field to determine whether the checkbox is set or not.
3) set the value of the hidden field as appropriate with for the select or unselect event when the button is selected.
P. -
Interactive Report - Go button perform a page submit?
Hi,
Is it possible to obtain a normal page submit when the Go button in Interactive Report is submitted?
I would like a normal page submit as this is the reliable way to have my different check boxes and select lists saved. These checkboxes and select lists act as bind variables in the IR query, and I do not get reliable results without the page submit. You may for instance experience that the report output looks ok according to your selections, but when you then download to excel, the report content reflects the true session state values.....
Alternatively is it possible to remove/hide the Go button? I could then add a normal button to perform the page submit. I just do not like to confuse my users with two buttons..... for the same purpose....
Best regards,
JesperHi,
With jQuery you can easily change that button attributes.
E.g. set button to submit page, add below to page HTML header
<script type="text/javascript">
$(function(){
$('.apex_finderbar_left .formlayout td input[value="Go"]').removeAttr("onclick");
$('.apex_finderbar_left .formlayout td input[value="Go"]').bind('click',function(){
doSubmit('MYREQUEST');
</script>If you like hide button, add to page HTML header
<script type="text/javascript">
$(function(){
$('.apex_finderbar_left .formlayout td input[value="Go"]').hide();
</script>Remember load jQuery javascript library also.
Here is one guide how install jQuery
http://www.danielmcghan.us/2008/06/jquery-in-application-express.html
Br,Jari -
Saving checkbox-state to table in Interactive Report
Hi,
I have been working with the information on http://www.apexninjas.com/blog/wp-content/uploads/2012/03/Checkboxes_in_Interactive_Reports.pdf to create an interactive report with a column containing a checkbox for each row.
My report contains the following (simplified):
Task_id, Employee_id, Checkbox_column
The checkbox_column keeps track of which employees work on which tasks, so it could be:
Task_id, Employee_id, Checkbox_column
1 1 0
1 2 1
1 3 0
signifying that only employee 2 works on task 1.
Now, I need to be able to change the 0 to 1 by clicking the checkbox, which already is possible, but I have problems saving that row to the database. Saving the checkbox state is also included in the PDF I used (page 12-14, 'Saving the checkbox state #2'), but I don't really understand where to put the scripts, I haven't worked with scripts and processes before so I could use some help understanding which script I need to put where. All in all, it's not too much code, I just don't understand where to put it.
The scripts mentioned in the PDF are:
The first one is a SQL-statement or a package, I imported the package in my environment, so I won't put the SQL here
This is the only one I know where to put:
<script type="text/javascript">
function getCurIRTab()
var temp_base_report_id = $v('apexir_report_id');
return temp_base_report_id;
</script>
This I don't know where to put:
<script type="text/javascript">
document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
</script>
the PDF says:
Now, create a hidden (just hidden, not protected!) item called P_IR_REPORT_ ID inside a HTML region.
Important! This region has to be rendered afterthe Interactive Report, so create it in the “after footer” display point!
In this regions’s footer paste the following JavaScript code, that will assign the hidden item P_IR_REPORT_ID the value of the Interactive Report ID.
But can we create a region in the after footer?
This I don't know where to put because the document doesn't specify it:
apex_ir_query.ir_query_where
(:APP_ID,--application id
99,--page id
:SESSION,--sesion ID
: P_IR_REPORT_ID -–interactive report ID);
This I don't know where to put, but I guess it's a 'processing' process:
declare
whereStmt varchar2(2000);
sqlStmt varchar2(2000);
begin
whereStmt := apex_ir_query.ir_query_where(:APP_ID,
99,
:SESSION,
:P_IR_REPORT_ID);
sqlStmt := 'update CHK_TEST set SELECTED = 0 where SELECTED= 1'||whereStmt;
execute immediate sqlStmt;
if APEX_APPLICATION.G_F01.COUNT>0 then
FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
update CHK_TEST
set VALID_LINE = 1
where SELECTED_ID = APEX_APPLICATION.G_F01(i)
and VALID_LINE = 0;
END LOOP;
end if;
end;
Can I please get some help understanding where exactly to put these scripts?
I've been looking around on the forum and Google but I can't find the detailed answer to what I'm looking for anywhere.
I am currently working with the test environment Oracle supplied us, because we are testing if we can use APEX at our company.
The version is Application Express 4.2.2.00.11 and it's running on Oracle 11g.
Just ask if you need any more info.
Thanks for the answers!
NDGPlease put together an example application on apex.oracle.com and provide developer credentials. This would help prevent multiple posts back and forth about try this, try that, now try this, now try that......
But until you do that try this:
I think you already know that the following goes in the page html header.
<script type="text/javascript">
function getCurIRTab()
var temp_base_report_id = $v('apexir_report_id');
return temp_base_report_id;
</script>
Alternately, since you are on apex 4.2 you could just add it to the Page Attributes->JavaScript->Function and Global Variable Declaration field (without the script tags):
function getCurIRTab()
var temp_base_report_id = $v('apexir_report_id');
return temp_base_report_id;
Now you need to create an HTML region (in display point "after footer"). Then you create the P_IR_REPORT_ID hidden item inside your new region.
In the region definition you will put the following code into the region footer:
<script type="text/javascript">
document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
</script>
Alternately, you could try to add the line to the Page Attributes->JavaScript->Execute when Page Loads field:
document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
This is just an example of the procedure call you will make in your page process.
apex_ir_query.ir_query_where
(:APP_ID,--application id
99,--page id
:SESSION,--sesion ID
: P_IR_REPORT_ID -–interactive report ID);
It is included in this code which you will put into a page process.
declare
whereStmt varchar2(2000);
sqlStmt varchar2(2000);
begin
whereStmt := apex_ir_query.ir_query_where(:APP_ID,
99,
:SESSION,
:P_IR_REPORT_ID);
sqlStmt := 'update CHK_TEST set SELECTED = 0 where SELECTED= 1'||whereStmt;
execute immediate sqlStmt;
if APEX_APPLICATION.G_F01.COUNT>0 then
FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
update CHK_TEST
set VALID_LINE = 1
where SELECTED_ID = APEX_APPLICATION.G_F01(i)
and VALID_LINE = 0;
END LOOP;
end if;
end;
Ok, clear as mud! -
Interactive Report with Checkbox column
Hello everyone,
our users love the Interactive Report filtering, so they want all forms in apps. to behave like Interactive Reports.
I need a form where each row consists of 2 columns and a checkbox, that handles some flag. I can create checkboxes using APEX_ITEM, however, the filtering on such column look ridicolous. I would like to have a tabular form (with one editable checkbox column), but with all those Interactive Report filtering features.
Is there any example (or inspiration) how to achieve such functionality?
Thanks a lot!
AdamHello Adam,
Why don't you just switch off the Filtering option for that column?
(Go to the Interactive Report, click on your column, then in Column Definition you can (un)check the features for that column).
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
How to select records from Interactive Reports based on checkboxes
Referring to the link below
http://apex.oracle.com/pls/otn/f?p=31517:95
I want to select rows from the Interactve Report based on a checkbox. This demo page has 2 sections, one for classic report and other for interactive one. The classic report is able to select the whole records but the interactive report selects only the emp nos. I am looking for a functionality where I can select the whole record from the interactive report.
Any pointers will be helpful.
ThanksThat is easy. You should just modify the query:
DECLARE
v_count INTEGER := 0;
BEGIN
:p95_text_ir := NULL;
FOR i IN 1 .. apex_application.g_f20.COUNT
LOOP
v_count := v_count + 1;
FOR c IN (SELECT ename, job, mgr, sal, deptno
FROM emp
WHERE empno = apex_application.g_f20 (i))
LOOP
:p95_text_ir :=
:p95_text_ir
|| 'ID: '
|| c.empno
|| ' / '
|| 'Name: '
|| c.ename
|| ' / '
|| 'Job: '
|| c.job
|| ' / '
|| 'Manager: '
|| c.mgr
|| ' / '
|| 'Salary: '
|| c.sal
|| ' / '
|| 'Department: '
|| c.deptno
|| CHR (10);
END LOOP;
END LOOP;
:p95_text_ir := :p95_text_ir || ' / Records selected: ' || v_count;
END;Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
HTML Code text appearing instead of checkbox in an interactive report
Hi All,
When I try to include a check box column in an interactive report only the HTML text is being displayed as
<input type="checkbox" name="f01" value="1739" />.
However check boxes are working fine in other application and also in other sample test reports that I've tried on...
Could you please give any ideas as to why this is happening?
Thanks in AdvanceHi,
Change column to Standard report column from report attributes.
Br, Jari -
Interactive Reporting:Error reading data of InfoProvider /CRMBW/CSAL_C01
Hi Forum,
I configured an interactive reporting to read interaction record data.
When I execute the reporting, I am getting the following error message:
+Error reading the data of InfoProvider /CRMBW/CSAL_C01+
+No destination exists to source system YYYCLNT999+
The RFC mentioned in the error message is not the correct one. But I checked the configuration in RSA1 and the RFC mentioned there is the correct one. So, I think I am missing a customizing that is pointing to the wrong client...
Any idea ?
Thanks a lot and best regards.Hi,
first you should check the overall configuration. Go to your CRM client and run transaction /CRMBW/CONFIG_WIZARD. If there are errors or warnings, solve them step by step. The transaction should be self-explaining but may require some expertise (the documentation provided should help, though).
Best regards -
Checkbox interactive report not working...
Problem in image
http://i.imgur.com/9Ptym.png
my interactive report query
select "ROWID",
"DB_ITEM_ID",
"DB_CUST_ID",
"DB_NAME",
"DB_ADDRESS",
APEX_ITEM.CHECKBOX (3,DB_CUST_ID) AS Edit
from "#OWNER#"."DB" for some reason my check box would show up in html code...
resources im looking at:
https://apex.oracle.com/pls/apex/f?p=40323:1:1513972688392601:::::
http://ioug.itconvergence.com/i/doc/api084.htmHi,
See below links
Re: Check all checkbox in an interactive report
Re: Dispaly / Filter checkbox field in IRR
Re: Need help with APEX_Collection
http://actionet.homelinux.net/htmldb/lspdemo?p=83
Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0 -
Checkbox (check all) in interactive report behaves not as expected.
I have created an interactive report with one column being apex_item.checkbox (1,key,checking_expression).
To be able to check all rows, I have put the following code in the column's heading field:
<input type="checkbox" onclick="checkAll(this)" value="1" name="x01"/> (code got with Firebug from automatically generated tabform).
Well, the checkbox in heading checks/unchecks itself OK, but then, instead of checking all rows, a standard interactive column menu drops with sort/select value options.
I presume, I am missing something. But what?
IgorLooking with Firebug at at the generated code, I see the following:
div id="apexir_SEL_YON" style="text-align: center;" onclick="gReport.controls.widget(this.id)"
<input type="checkbox" name="x01" value="1" onclick="checkAll(this)"/>
/div
How could I patch away this onclick trigger?
Igor
Edited by: kortchnoi on Sep 2, 2008 12:11 PM -
Check all checkbox in an interactive report
Hi,
I would like to add a "check all" functionality in an interactive report. I've done that by adding a javascript function to the header, but when I click the column header to check all the page first executes the javascript that is used by the interactive report (sorting etc). Is there a way to disable this javascript for just the checkbox clolumn, so that my own javascript code is executed?
Or is there another way to add this functionality to the IR?
ThanksThat works great! Thanks jarola
The complete answer in case anyone needs it is to first include the checkbox column in your IRR query
APEX_ITEM.checkbox (1, ca.id) del
Then include this as the column heading
<input type="Checkbox" onclick="$f_CheckFirstColumn(this)">
Then include the code as identified by jarola in the page HTML Header
<script type="text/javascript">
addLoadEvent(RemoveChkOnclick)
function RemoveChkOnclick(){
$x('apexir_DEL').onclick='';
</script>
Edited by: Bill Wheeling on Aug 1, 2010 4:12 AM
Edited by: Bill Wheeling on Aug 1, 2010 4:36 AM
Maybe you are looking for
-
What do i do when my itunes will start downloading the software update. But then once its done, it will tell me that it cant connect to the server. even when i am?
-
Any way to create tablespace with name greater than 30 characters ?
Is there any way to create tablespace greater than 30 characters on solaris 10 and Oracle 10g. Any way ? because i have no other option.
-
Does anybody know why Illustrator will open Solidworks DWG files saved in R2007-2009 version but not version R2010?
-
Hi! I have problem with creating text object which should be java script (for enabling one go button on dashboard). I have no option for enable HTML Markup. I see in documentation that check box for that should be marked, but I don't have that box. I
-
Hi Gurus, I'm new to FSCM. My requirement is that I have to implement the BADI UKM_CHECK_STEP so that a Sales Order is blocked when the Payment Term has value 'XXXX' even if the customer has sufficient available credit limit. Can anybody please sugge