I am trying to display a value of an item like that:
Some text &P5_ITEM.
It's works only when I refresh a page, without refreshing I can only see a previous value of an item.
I tried to submit a item value with dummy pl/sql
null;
Items to Submit &P5_ITEM.
but it didn't work
It's work only with a javacript
Location.reload()
But it is not a solution becouse it invokes reload after reload since dynamic action starts when page load.
I figure out how to fix that, instead of calculating value of an item in dynamic action fired when page load I passed value of the item in link attributies and it's working properly.
Related
I have used Fresh MVMM. I need to pass a data from one page model to another page model without using init and reverse init.
Eg: I have one toggle button in first content page.
I need to toggled the button based on the selection in second popup page without popup the second PopPopupPageModel.
ReverseInit is worked when popup the second PopPopupPageModel and can easily pass data.
But I need to toogled the button in first page without popup the second page.
Please help...
I have a function that returns a value (e.g.27).
I am put this value to my page item (P2120_SYMPTOM_ID) and i want with this value to open with button another page (P2140).
I am going to button Link builder - target and i am using P2120_SYMPTOM_ID like this:
but unfortunatendly this value doesn't pass to my new page criteria.
How can i use this value?
If you're just navigating to another page (as opposed to opening a modal window) then use action "Submit" on your button and create a branch to the new page. That is how navigation is supposed to be done. The link builder links are generated when the page is rendered and do not pick up session values.
This is a common question, and relates to the fact the link uses values during page render, not what may have happened during interaction with the page
A common solution is presented in the Oracle forums here
https://community.oracle.com/tech/developers/discussion/3725149/pass-client-side-state-to-modal-dialog
Alternatively, there is a free & supported FOEX Redirect plugin that also solves this problem
https://fos.world/ords/f?p=10000:1080
I have a problem regarding modal popup and session.
I have two component name test and test1 respectively.
In test there is a form in view in which i put "Anchor" tag with "modal" class. has also class name "class1".
When i clicked on Anchor tag it call click function(on click "class1") in which i put ajax code for set data using "Session".
$('.test').click(function(){
// Ajax code here for set data using session
});
with above function it also called modal popup. here targer url is seted which is the view of 2nd component which is "test1".
Here in test1 there is a view.html , we are getting session data here and displaying in view.
PROBLEM
Problem is that , here in 2nd component , in view i am getting session data but i need to click on button two time , only after i getting data properly.
When i click on it give me a old session data. and when i click on it second time it will give me a proper data.
What is the solution for above problem. if anyone know please let me know.
Session data is altered only after we click on Anchor tag.
Both thing is done on Anchor click , one is for set data in session and second is for modal popup. in popup i am getting data which set in session.
when is the session data is being altered?
Is it altered by ajax call too?
In this case, javascript, is unsynchronous. It doesn't wait for something to happen in order to fire the next line of code. In that case there are several techniques you may find to do so.
I have a CodeIgniter webpage containing (i) a list of items and (ii) a form to add a new item or edit the details of a selected item.
To select an item for editing, I have an "edit" anchor tag with a hyperlink ending with ?id=nnn. This results in a GET request that populates the detail fields of my selected item and redisplays the list. My URL now contains site_address/index.php/country?id=151.
When I submit my changes the list is updated correctly but my URL remains unchanged. What do I need to do in my controller to remove "?id=151 after my update was successful?
Thanks for your help.
I'm not sure of everything you are doing, so I'll just answer directly:
in your controller, after you update, you can:
redirect('site_address/index.php/country');
Does that fit what you mean?
Through php there's no way to change URL after request expect redirecting
redirect('controller/method');
and you can success message using session flash message after redirecting, if that what makes you want to reload the view
I have two Main reports. Each report has a corresponding region with a Nonmain Classic report (so 4 reports total). Clicking on a link in each of the Main reports reveals details in its corresponding Nonmain report.
Currently, clicking on a Main report will reload the whole page, and all the PL/SQL and SQL has to refire from all 4 reports.
It would cut down on the SQL calls if only the nonmain report refreshed. I assume AJAX would be the best bet to accomplish this.
How would I go about doing such a task?
Thank you.
P.S., all four reports are determined by a PL/SQL function returning a SQL statement. All headings also are determined by a PL/SQL function returning a colon-delimited string.
With your previous questions in mind, your classic reports rely on the session state of some page items. You are setting the value of these items in your colunmn links.
If you want to cut out the submit of the page then you need a way for the anchor tags to not fire their default action and provide the value for page items to be set to a dynamic action.
You have to put this in the column link attributes:
onclick="return false;#" class="reportlink1"
You then need to pass on some data, and i suggest using data tags
data-value1="#COL1#:"
Create a dynamic action, firing on click and uses a jQuery selector .reportlink1
What needs to happen now is to provide the page items with their needed values
Add a true action to execute javascript:
var lValue1 = $(this.triggeringElement).data("value1");
$("P1_ITEM1").val(lValue1)
With the item value set, create another true action of type "Refresh" and set it to affect your secondary report.
The final step is then to set the "Page items to submit" on the secondary report. This will cause the report to submit the values of the set page items to the session and ensures that the sql will return the correct values when the region is refreshed.
For some reason, Tom's approach did not work for me; I assume it must be the idiosyncrasies of my page. If anyone stumbles upon this question, try Tom's method first, and if for some reason it doesn't work then try the following adaptation with AJAX in the dynamic action:
If your nonmain reports rely on the session state of some page items, and those items are set via column links from your main report, you must put this in the column link attributes to prevent the submission of the page and to pass the values using data tags:
onclick="return false;" class="reportlink1" data-value1="#COL01#" data-value2="#COL02#"
Create a dynamic action, firing on click and using a JQuery selector .reportlink1
Provide the page items with their needed values VIA AJAX. Add a true action to execute synchronous javascript:
var v1 = $(this.triggeringElement).data("value1");
var v2 = $(this.triggeringElement).data("value2");
var get = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=dummy', &APP_PAGE_ID.);
get.add('PX_ITEM1' , v1)
get.add('PX_ITEM2', v2);
gReturn = get.get();
get = null;
With the item values set, create another true action of type "Refresh" and set it to affect the secondary report.
Unlike Tom's solution, DO NOT set the Page Items to Submit on the secondary report.