At this moment I'm working on an Oracle Apex page, which as one Interactive Report (let it have id my_report) and two checkboxes P1000_FLAG_1 and P1000_FLAG_2, which are related to the former and which help me to select some part of the IR's query. Since Apex doesn't suppose checkboxes to make a submit (what isn't right for radiobuttons), I wrote the Javascript function as a workaround:
/* On change any checkbox */
function toggleQuery(nFlag){
if(!(nflag > 0 && nFlag < 3)) return;
sFlag = "P1000_FLAG_" + String(nFlag);
var nChecked = (document.getElementById(sFlag + "_0").checked ? 1 : 0);
apex.submit({set:{sFlag:nChecked}});
}
Also I have one process, which executes on load of my page:
/* Process: On Load — Before Header, Once Per Visit Page */
begin
--initiating several hidden values,
--which are not changed during working with the page
:P1000_HIDDEN := GET_HIDDEN(1);
--...here goes the code, which fills other hidden items...
--
--this piece stands for the default choice in current page
if :P1000_ENTERED is null then
:P1000_FLAG_1 := 1;
:P1000_FLAG_2 := 0;
else
:P1000_FLAG_1 := nvl(:P1000_FLAG_1,0);
:P1000_FLAG_2 := nvl(:P1000_FLAG_2,0);
end if;
:P1000_ENTERED := 1;
end;
My page works perfectly, when I make only choice by means of the checkboxes. But I have a problem, when I execute one action, which works with the help of AJAX callback and ends with this jQuery command:
$("#my_report").trigger('apexrefresh'); //there is only changing some styles (.css(...)) bound to IR refresh
When I open my page for the first time, do my action and then try to check the second checkbox (which is not checked by default), Apex behaves like I've opened the page again for the first time. I realised this, when I had tried to make all my hidden items unprotected (otherwise I got a error of trying to alter protected hidden items manually).
Thus my question is this: what should I do to make my page work correctly? I use Oracle 11g, Apex 4.2.6.00.03
Like Jeffrey said, you can refresh your IG with a dynamic action.
But don't forget to set the items to submit next to your SQL. After the place that you wrote your SQL there is a field "Items to submit", you need to put all items that you are using in your SQL in this field.
After this you can create a dynamic action to refresh the report when some item change.
Related
I’m fairly new to Apex but struggling with the wizard part.
I'm currently using apex 20.2
I have a wizard that works perfectly fine, passing item values from one form into another form item
I’m doing this with branches where in the behavior I set the value of the current form into the next one.
But somehow I cannot do it with the ‘previous’ button.
I would assume I could do the same, pas the item value from form 2 into the items from page 1
Then use that value as default item value?
But then I get an error saying there is no data.
Can someone point me in the good direction?
Thanks.
when pressing the previous button the action is a redirect to page 12, i would need to pass that P10_NAME value into form item P12_NAME
In Page 12 a was assuming i would need to set a default to the item where i have passed the data in?
With a link, the target is generated at page rendering time. It does not pick up the current values in the form.
Instead what you could do is
Change the button action to "Submit Page"
Create a pl/sql page process to set the values (point: processing, condition when button pressed)
Create a branch to redirect to the previous page (point: after processing, condition when button pressed)
The 2nd bullet is optional, you can also pass the values in the branch link. Since the branch is executed after processing the item values will be the new item values (and not the values at page rendering time you see in the link now)
I'm hoping to select a particular Region to highlight on the page load based on the link the user follows to get to that page. This is a drill-down report with multiple options, so the goal is to have all options available but focus on the one the user selected to reduce the number of times a user has to navigate to/from the base report to the drill-downs.
Currently, I'm trying to implement this solution https://svenweller.wordpress.com.../, further explained in an Oracle Community discussion here: https://community.oracle.com/..., but it is not working for me.
What I have now is similar to what is shown in those examples, and for now I'm just trying to link to a static Region Display Selector (RDS) tab (the goal will be to have the selected Region be dynamic based on which link is clicked in the feeder page, but I'm clearly not there yet).
I have a Dynamic Action set to fire on Page Load event, and a True action that executes JavaScript code and uses the JavaScript in the example (both with and without the Timeout function suggested in the Oracle thread). I have set Static IDs for the RDS and Region, but when I load the page the RDS still defaults to Show All (or the first region if Show All is off).
Can someone help me understand what I'm doing wrong?
Thanks.
let sesStorage = apex.storage.getScopedSessionStorage({
useAppId:true,
usePageId:true});
setTimeout(sesStorage.setItem( "tabs.activeTab", "#R3" ) { apex.region("tabs").widget().aTabs("getTabs")["#R3"].makeActive();}, 300);
\\version without setTimeout
let sesStorage = apex.storage.getScopedSessionStorage({
useAppId:true,
usePageId:true});
sesStorage.setItem( "tabs.activeTab", "#R3" );
I have done something like this in the past. Create a hidden variable on the page P1_TEST, make sure to set the value not to be protected.
You will need to set the value of that variable when the link is clicked.
Then you need to add static IDs TAB1, TAB2 etc. to the tabs of you region display selector.
Then add a DA on Page Load:
if (apex.item("P1_TEST").getValue() === "Value1"){
$(".apex-rds [href='#TAB1']").trigger('click');
} else if (apex.item("P1_TEST").getValue() === "Value2"){
$(".apex-rds [href='#TAB2']").trigger('click');
}
Good evening to everybody.
At this moment I'm working on a new page for Oracle Apex and again I have trouble with Interactive Report. My page (let it be named 500) consists of Interactive Report with id rep_main and Classic one with id rep_child, which are connected by master-detail logic (I choose the row from the main report and then I get the rows in the child one depending on my choice). Also every row of the main report has several buttons (precisely tags "a" with links like "javascript:..."), which call dialog windows for updating data of the chosen row.
My aim is to make page more comfortable for users: firstly, the chosen row from the main report should change its color; secondly, the reports should refresh correctly. The second condition means, that, after I choose the rown in the main report, the pagination must not change and the view of the page must not scroll up by itself.
I managed to make the master-detail logic and recoloring the rows (thanks to Stack Overflow for helping me with this task) in my IR, but I have some difficulties with the condition of correct refresh. Apart from JavaScript/jQuery functions, I have to call standard Apex function apex.submit, because if I don't do this, pagination of my IR won't save, but at the same time the page scrolls up by itself, which is very unlikely for users. Moreover, the pagination resets after any dialog window appears.
I've tried to find solution in Google, but all is in vain. I hope that somebody knows if there is any workaround in my case (against the scrolling up at least).
I use Oracle Apex 4.2.6.00.03 and application is executed mainly through Mozilla Firefox. The code I wrote for my page 500 is written below in the current post.
On the page load executes the process with PL/SQL lines like this:
:P500_MAIN_ID := APEX_UTIL.GET_NUMERIC_SESSION_STATE(P_ITEM => 'P500_MAIN_ID'); --receiving the chosen row's ID saved in session
The main report region header contains the following script:
<script>
$("#rep_main").find("table.apexir_WORKSHEET_DATA td).live("click",function(){
var chosenOne = $(this).find("span").attr("id"); //finding ID of the chosen row
chooseMAIN(chosenOne);
apex.submit({set:{'P500_MAIN_ID':chosenOne,'P500_CHILD_ID':null}});
});
</script>
In this code P500_CHILD_RN is the item for saving ID of child report's row and the function chooseMAIN is:
function chooseMAIN(docID){
$.post('wwv_flow.show',
{'p_request' : 'APPLICATION_PROCESS=SET_MAIN',
'p_flow_id' : $v('pFlowId'),
'p_flow_step_id' : $v('pFlowStepId'),
'p_instance' : $v('pInstance'),
'x01' : docID},
function(data){
//for the opportunity to get the ID in pure JavaScript
$("#P500_MAIN_ID").val(docID);
$("#P500_CHILD_ID").val("");
$("#rep_main").trigger('apexrefresh');
$("rep_child").trigger('apexrefresh');
}
);
}
The process SET_MAIN looks this way:
begin
APEX_UTIL.SET_SESSION_STATE(P_NAME => 'P500_CHILD_ID',P_VALUE => NULL);
APEX_UTIL.SET_SESSION_STATE(P_NAME => 'P500_MAIN_ID',P_VALUE => APEX_APPLICATION.G_X01);
end;
p.s. Earlier I asked some help with IR here, but I still haven't found proper solution (except making a submit, which has its side effects I said about).
what you really want to use in this case is the FOEX plug-in because its AJAX based so you don't need to submit.
FOEX website
And do yourself a favor and move away from 4.2 you'll thank me later..
i am designing a form in Livecycle es4 designer, the form is saved as .xdp and we have a .xml as input, based on the data stream the form extends to n number of pages, i need to end my form on an even page always,
if there are 3 pages based on the data, i need to show an blank page as the 4th page. if there are 4 pages based on data stream we need not show the extra blank page.
i have added a blank page in my designer made it hidden from layout, , wrapped in a sub form and in the layout editor :ready i have written the following script
var pageCount = xfa.layout.pageCount();
if(pageCount%2==0){Blank.presence = "hidden";}
{Blank.presence = "visible";}
but my form now which is 3 pages does not append the blank page, any direction will be very helpful.
Thanks in advance
CW
Firstly, layout:ready event fires every time the form changes. For example:
initialy 3 pages -> script adds one more -> form changed -> script fires again and removes 4th page...
Secondly, is the Blank(empty page) visible or hidden from the start? Depending on that the Blank will be included or not in the page count at the first script run.
You could set Blank as visible from the start and per script remove it if the condition is true. You won't need else-part in this case.
Actual Question:
Does anyone have any basic example logic of how to pull the value of a DOM element in to a custom script data element?
Background:
I'm trying to build some custom data elements in Adobe Dynamic Tag Management (DTM). I want to capture specific sections of my breadcrumb in to elements - e.g. Given breadcrumb trail Home >> Category 1 >> Category 4 >> Page 1, I would want X = Category 1, Y = Category 4, Z = Page 1
Unfortunately, the anchors in the breadcrumbs do not use consistent identifiers, so I need conditional logic in order to select them. Example: When I'm on the Category 1 landing page, the category's element has ID "Current" but otherwise it has the id "L1Link" - therefore I would want the following logic:
if(#L1Link exists)
X = #L1Link
else
X = #Current
Unfortunately, I'm not sure how to select a DOM element in my Custom Function. I don't think _satellite.$data is what I want (I don't want data, I just want the text of the hyperlink). I tried using cssQuery, but I don't really have a callback to pass anything back to (and contrary to the documentation, it seems to get very upset if I don't have a callback).
Go to Rules > Data Elements and create a Data Element with the following:
Name: category_1
Type: Custom Script
Then click on "Open Editor" and add the following:
var x = document.getElementById('L1Link')||document.getElementById('Current');
if (x) return x.innerText||x.textContent;
else return '';
This will first look for #L1Link and failing that, will look for #Current. If it is found, it will return the link's text.
Based on your post, set Remember this value for as "Pageview"
Save Changes
Next, navigate to
Rules > Page Load Rules
If you don't already have a general page load rule setup that is set to pop on every page load, create one and name it something like "every page".
In the Conditions > Criteria choose Data:Custom from the dropdown and then click Add Criteria
Then add the following in the Custom textarea:
return _satellite.getVar('category_1')||true;
This condition will explicitly invoke the data element to ensure that it gets invoked, because DTM is moody and sometimes may not evaluate data elements. It falls back to true to ensure the condition always returns true, so that the condition will not cause the rule to fail to execute.
Then in the Adobe Analytics section of the rule, choose whatever eVar and/or prop you want to set (e.g. prop1) and set as %category_1%
Save Rule
You will want to repeat this process for each item you are looking to make a data element to pop an Adobe Analytics variable for, though you only need one rule, and one condition for all of them. The condition code would be:
_satellite.getVar('category_1');
_satellite.getVar('category_2');
//etc..
return true;
NOTE: DTM has some caveats of order of execution vs. load/timing of things. This is in part due to the nature of async loading but there is also a mislabeling of order of execution in the documention (see my Issue #2) that Adobe has acknowledged. Basically, you may need to play with the Trigger rule at setting in the page load rule vs. what you set the "Load Adobe Analytics page code at" dropdown to in the Adobe Analytics Tool General config section and hope for the best. I setup a test page to verify all this in my post and pretty much anything I chose in either one worked, but then my test page had virtually nothing on it except the DTM page code and a link.
Very interesting this post, always your explanations are very clear #crayon. By the way, you know how call data elements into script on Thirth party tags (HTML non sequential)? I'm trying to do and honestly, I miss.
When use a Java script non sequential I can take Data element, but my intention is pass Data Element value into image pixel, like:
<img src="//t.qservz.com/tr.aspx?campaign=169779d3852b32ce8b1a1724dbf5217d&type=ppl&retmode=4&orderid=[[orderid]]&totalprice=[[totalprice]]&level=**ValueDataElement**&redirect_url=[[URL]]" border="0" width="1" height="1"><img style="border: 0;" width="1" height="1" src="https://tags.qservz.com/pixel?id=1901&type=img" />
If you can help me, I'm grateful,
Julià.