I am trying to refresh dynamically a region on a page from dynamic action. I have a select list loaded from the database.When the select list change its value, the region will refresh.
the the source of my region contains a img tag like this:
<img src="#APP_IMAGES#&P10_language..png" />
The problem here is when i change the select list,
the image still unchanged and it doesn't refresh.
Is there a solution ?
A simple solution is to change select list item's Page action on selection. Currently, it is "None" (I presume). If you set it to e.g. Redirect and set value, browser will redirect to current page (and refresh it), while select list item's value will be stored into the session state.
If you don't want to refresh the entire page, you can
create a dynamic action on change of the item that refreshes the region
ensure your region is some form of refreshable region (classic/IR/IG)
ensure you set the item in the 'page items to submit' region property
And ideally not use &ITEM. syntax in your SQL
Related
I have to regions with items on my page. One of them is to edit data, another one is display only. Editable region is hidden on page load and shows when users click on a button. I'd like to pass data between these regions after submit a page. Are computations after submit the only way to do that? I tried with processes after submit, before header etc. but it didn't work.
I'd like to have one pl/sql code to pass data between two regions after submit, how to do such a thing?
Other options include
dynamic action (you'd use Set value)
button's Redirect to page in this application (where you'd redirect to the same page; Link Builder then lets you choose which items will be set to which values)
If you still can't make it work, consider creating sample page on apex.oracle.com; then provide login credentials so that someone might have a look.
I am using this code fragment:
BEGIN
GO_BLOCK('COMPANY_PRODUCTS');
EXECUTE_QUERY;
END;
in WHEN-NEW-FORM-INSTANCE of my form module.
I also changed the text items of my data block into display items.
The problem is that when I start running my form module, it displays an error stating:
FRM-40106: No navigable items in destination block.
It doesn't have "Enabled" and "Keyboard Navigable" property.
The reason I changed it to display items is because I don't want the user to click and edit the text on the item.
Is there any way can I get through this problem? or should I just stick with text items?
Screenshot: Form Module on Web Browser
make your destination block's all item Display Item, except leave one of them as Text Item ( preferably the first one in the physical sequence of items [topmost or leftmost]). And then, set that text item's Update Allowed and Insert Allowed property to No from Database section of Property Palette.
This is for Oracle Apex 5.
I have a static content item on my login page, it has registration fields with a dynamic action button. Upon the click of the button their details are inserted into a table. I'd like the fields to disappear and 'registered. email verification sent' text to appear in that static content?
If that's not possible, is there a way for me to write that text underneath the registration fields and at the same time, clear all the fields - after button click?
If I understood correctly you have a Static Content Region (not item) with some text as source and you want that text to change if so i suggest you add a Display Only Item inside the Static Content Region and in that Dynamic Action simply change the value of the item using pl/sql, javascript or Set Value Dynamic Action.
Edit: You can use this plugin to have a timer that will run a Dynamic Action to change the text.
I have a blank page with a static content region (Template = Form Region). I select a project via a select list (there is only one project, so it automatically selects it). I then have a key popup lov (a popup lov that displays the description not the returned number value) from which I select a person to be in this project. I am trying to get the form to display the person I selected and saved previously when the form launches for the first time (since the project is chosen due to there being one). This works when you refresh the page, but it doesn't work if you log out and log back into the form. I tried using the default value with a sql query. I tried using a dynamic action that fires when the project changes; but neither approaches work. I fiddled with all the settings, but couldn't get anything to work. Does anyone know how to accomplish this in Oracle APEX?
I even added a refresh of the cascading popup lov to the dynamic action. I can see the hidden input item showing my defaulted value, but the popup lov does not display it on screen. Is this an Oracle bug?
Also in Javascript from the console
$s("P51_LINE_MANAGER1", "7104");
sets the hidden value, but doesn't display on screen.
$v("P51_LINE_MANAGER1");
does however return 7104.
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.