Oracle 12c
Apex 4.2.
Hello,
I have an application and few pages.
Page 2. It has more than 1 reports and link to page 3 from all reports.
There are some restrictions so I can't simply use page redirect to page 3 when select report link (ID).
When click the report link then it should check the selected ID is not already open on page 3. So if any user is using so same user or other users can't open page 3 with same report link ID.
I did some tricks but not 100% working.
1. Give an ID to report link item id="clickme" for all reports ( I have more than 1 report on same page)
2. Made a javascript function for report items that will carry to page 3
3. Calling JS function from report link selecting URL and passing report items
4. Application process (set_values)
BEGIN
APEX_UTIL.SET_SESSION_STATE('P1_X',:P1_X);
END;
5. function ge_value(xid, xyear) {
$x('P2_ID').value = xid;
$x('P2_YEAR').value = xyear;
var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=set_values',$v('pFlowStepId'));
get.add('P2_ID',xid);
get.add('P2_YEAR',xyear);
get.get();
$('#P2_ID).change();
}
6. javascript:get_values('#ID#', '#YEAR#'); report link url
7. Created a Dynamic Action
Click jquery selector #clickme
True action plsql
1. Insert into table (temp table for session, user, counter and report link id)
Basically if first time then insert otherwise update counter 2 if same report id selected . I created this table to insert and run some code to check if same record is exists and being updated by another user so other user cannot use the same ID.
2. True action
JavaScript. I check if counter is 1 then redirect to page 3 with report items
If counter is 2 then get xnd alert message on page 2.
Problem/ Issue.
On page 2 Item P2_ID and P2_YEAR
session shows the right selected values and javascript function is working too but when page redirect to page 3 so page items values are null or 0 but when I go back page 2 and select same report row or another row then it goes to page 3 and display record for last selected row. So it means page 2 items values is in session but not submitted so that's why page 3 is blank first time and then display when I come back from page 2 but display last row data.
same issue for insert table. It insert 0 then last selected row.
Please help. Thanks in advance.
Kind regards
IR