4.2: disorders plugin dynamic action
I'm running into some problems with some plugins for dynamic action, I have created and are on apex.oracle.com and has stopped working since the 4.2 update.Here a small example configuration for a very simple example:
< ul >
< li > create new plugin, give it a name. Type: dynamic action < /li >
< li > sources > PL/SQL Code
FUNCTION test_render(
p_dynamic_action IN apex_plugin.t_dynamic_action,
p_plugin IN apex_plugin.t_plugin )
RETURN apex_plugin.t_dynamic_action_render_result
IS
l_retval APEX_PLUGIN.T_DYNAMIC_ACTION_RENDER_RESULT;
l_crlf CHAR(2) := CHR(13)||CHR(10);
l_fetch_delay INTEGER := p_dynamic_action.attribute_02;
l_char_amount INTEGER := p_dynamic_action.attribute_03;
BEGIN
IF apex_application.g_debug
THEN
apex_plugin_util.debug_dynamic_action(
p_plugin => p_plugin,
p_dynamic_action => p_dynamic_action
);
END IF;
apex_javascript.add_library(
p_name => 'init_test_script',
p_directory => p_plugin.file_prefix,
p_version => NULL
);
l_retval.javascript_function := 'function(){init_test();}';
RETURN l_retval;
END;
< /li >< Li > reminders > make the name of the function
test_render
< /li >< li > no attributes Standard only checked < /li >
< li > no custom attribute defined < /li >
< li > a file, "init_test_script.js".
function init_test(){
//creating of the date filter fields
var l_table =
$('<table id="testtable">' +
' <tr>' +
' <td align="right"><label for="test_item_1">Test Item 1</label></td>' +
' <td align="left"><input type="text" id="test_item_1" /></td>' +
' </tr>' +
' <tr>' +
' <td align="right"><label for="test_item_2">Test Item 2</label></td>' +
' <td align="left"><input type="text" id="test_item_2" /></td>' +
' </tr>' +
'</table>'
);
$("div#appendsomethinghere").html(l_table);
};
(Not the material code much.)< /li >
< /ul >
< ul >
< li > now create a new blank page. < /li >
< li > creates a region HTML, source:
<div id="appendsomethinghere"></div>
< /li >< li > create a new dynamic action, event: the Page's Load
Real Action: the test plugin < /li >
< /ul >
Now, I expect to have the html code inserted into the dom when loading the page. However, I'm getting errors (surprise), and on the line that includes my action dynamic javascript_function.
Line: 96opening in the console
Error: Object expected
object expected f? p = 4000:RUN_PAGE:10169672371307:BRANCH_TO_PAGE_ACCEPT:NO:FB_FLOW_ID, FB_FLOW_PAGE_ID, F4000_P1_FLOW:54687, 55, 54687, character of the 96 142 lineis here:
93 <script type="text/javascript">
94 apex.da.initDaEventList = function(){
95 apex.da.gEventList = [
96 {"bindEventType":"ready",actionList:[{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:function(){init_test();},"action":"PLUGIN_TESTPLUGIN"}]}];
97 }
98 </script>
It seems as if the javascript file isn't there, even though I see the inclusion in the html code:<script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=940791031207478253&p_security_group_id=27000294100083787867&p_file_name=init_test_script.js"></script>
Even when I try to callinit_test();
from the console, I get the same error.When the same configuration is created in 4.1.0 it all works as I'd expect.
Anyone with any ideas or light on this?
Hi Tom,
It was actually the error of interest
Uncaught SyntaxError: Unexpected token ( /pls/apex/wwv_flow_file_mgr.get_file?p_plugin_id=940791031207478253&p_security_group_id=27000294100083787867&p_file_name=init_test_script.js:1
that was displayed in the Chrome developer tools.
The reason was the function declaration
function() init_test{ -> Uncaught SyntaxError: Unexpected token (
It should be
function init_test() {
I have fixed your plugin init_test_script.js JavaScript file and now everything works fine. Are you sure who has worked at the APEX 4.1? Because it is a JavaScript error and has nothing to do with the APEX.
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf
Tags: Database
Similar Questions
-
Alertify Plugin - how to call via Javascript and not by a dynamic Action
Hello
Environment: Oracle APEX v4.2.1 | Oracle 11g R2 | IE8 Web browser
Hoping someone can help, I use the plugin Alertify via a dynamic Action, but my question is, instead of use this via a dynamic Action, I actually want to make the same call I do via a dynamic Action but rather using javascript.
So, by using a shape any JavaScript API in the Alertify plugin, I want to call an alert notification standard with the message and the delay effect until it disappears once more.
Is it possible to call this plugin in this nature using javascript?
Thank you.
Tony.
You can always use the plugin and a custom event.
Create a dynamic action:
- Event: Custom
- Custom event: ALERTIFY_DELAY
- Selection type: jQuery Selector
- Selector: body
- 1 real action:
Add the following code to the section "run when Page Loads:
window.setTimeout(function(){ $('body').trigger('ALERTIFY_DELAY'); }, 3000);
This will cause the "ALERTIFY_DELAY" event fires after three seconds.
-
Obtain / use value radio in Apex plugin for dynamic action button
Apex 4.2
I'm working on a plugin that you run a dynamic action based on the value of a selected option button. I think its more so the syntax that is causing me problems.
I have a point page (P127_DISPOSITION) reprsented as a group of radio buttons. There are three cases for the Group of radio buttons: CREATE, update, and THROW. The LOV source for the element on the page is:
STATIC2: create new Inspection; CREATE, update of existing Inspection; Updated, throw; IGNORE
I have a plugin that displays a map and a few other neat, tools and toolbars other clever tricks. When a user clicks on the radio button under the UPDATE, the card must hide some of these tools. This part is not so bad that I have the code for this. Here's what I or tried so far:
$("#P127_DISPOSITION").change(function() { if ( $("#P127_DISPOSITION").val == 'UPDATE' ) $("#draw_point").hide(); $("label[for=\draw_point\"]").hide(); } else if ( $("#P127_DISPOSITION").val == 'CREATE') $("#draw_point").show(); $("label[for=\draw_point\"]").show(); } else { $("#draw_point").show(); $("label[for=\draw_point\"]").show(); } });
The statements in the IF statements are not the problem. I tested and been using these statements in my plugin for other reasons. These statements just to show or hide the toolbar. But I'm doing this action happens dynamically on a radio button is selected. So I know there must be some problems in the way I use the onChange function or the statement real himself.
Any help on this would be greatly appreciated. Thanks in advance.
NewApexCoder
I don't think that your problem is with dynamic action, but how the html code that is generated when the plugin looks like.
If the generated html code is not a type of entry right front, you need to write your own javascript code that overrights the apex.item () .getValue (default).
To explain what I mean lets take a look at the native radiogroup and popup lov.
A radiogroup of point P40_DISPLAY_RETURN of the page html code looks like
As you can see the element with the id P40_DISPLAY_RETURN is the set of fields. Because the set of fields is not a value attribute neiter $x('P40_DISPLAY_RETURN').value and $('P40_DISPLAY_RETURN').val)
the value will give you. Apex. Item ('P40_DISPLAY_RETURN'). GetValue() will return the C.
And for the lov contextual element P40_POPUP_LOV of the HTML page looks like
Now the P40_POPUP_LOV element is an input element, but the value is the value to display. So $x('P40_POPUP_LOV').value and $('P40_POPUP_LOV').val () will give you the display value ' OHare, Edward "Butch" While apex.item('P40_POPUP_LOV').getValue () returns the return value 4.
Take a look at the getValue for both javascript code, you see that the functions are actually different and depend on the widget that is the element.
getValue : function() { // get checked input value, in the context of the fieldset // note: can't use $lRadios here because this is a reference // to the initial state var lReturn, $lRadio; if ( pType === "checkbox" ) { // checkbox will return an array lReturn = []; $( ":checked", lFieldset).each( function() { lReturn[ lReturn.length ] = this.value; }); } else { // radio group should return a single value $lRadio = $( pSelector + " :checked", apex.gPageContext$ ); if ($lRadio.length === 0) { // check if the length of the jQuery object is zero (nothing checked) // if so return an empty string. lReturn = ""; } else { // otherwise return the value lReturn = $lRadio.val(); } } return lReturn; }
-
Dynamic action for validation of date with the notification message plugin
Hi all
Someone help me please with dynamic action for validation of date with the message notification plugin. I have a form with two elements of the date picker control and message notification plugin.
The requirement first user selects the exam is finished and then selects the date. So, if the date is greater than the date of the examination is over + 2 years then doesn't trigger the message notification plugin. I tried to create that dynamic action on the date picker date that triggers the scheduled issue notification message but I want to make conditional, I mean displays the message only if date of the selected is greater than the date of the exam is finished more than 2 years.
In terms simple, notification is displayed only if provided is superior to (date of the exam is completed + 2 years).
I use oracle apex 4.0 version and oracle 10g r2 database. I tried to reproduce the same requirement in my personal workspace. Here are the details. Please take a look.
Workspace: raghu_workspace
username: orton607
password: orton607
APP # 72193
PG # 1
Any help is appreciated.
Thanks in advance.
Orton.
You can get the value of the date of entry:
$(ele) .datePicker ('getDate');
So what to add functions such as:
function validateNotification (d1, d2) {}
Date1 var = $(d1) .datepicker ('getDate');
date2 var = $(d2) .datepicker ('getDate');
if(date1 && date2) {}
return ((date2.getTime()-date1.getTime())/(1000*24*60*60))>(365*2);
} else {}
Returns false;
}
}
The logic based on setting (I have two years from years of 365 days preceding)
Then in the D.A. specify a JavaScript expression as:
validateNotification ('P2_REVIEW_COMPLETED', this.triggeringElement.id)
Refer to page 2 for example.
-
Several plugins using the same JS file dynamic action
Hello
(Apex 4.0.2)
I created two plugins for dynamic action, say Plugin1 and Plugin2. These two plugins are most of the time used together, so to keep things simple and ease of maintenance that all the JS need to the code specific to each plugin as well as of the common code is in a single file, for example plugins.js. So I download the same JS file to each plugin.
In the generated page, using two plugins the JS file is loaded twice, as planned. Of course, at Apex, they are two different files even if their content is exactly the same.
This is not ideal for me. What is the approach suggested in this case? Always keep the JS separate files for each plugin? And on any common code plugins share, duplicate in each JS file?
Thank you
LuisHi Luis,.
apex_javascript.add_library currently does not allow to specify p_key as for example apex_javascript.add_on_load_code is. It automatically calculates the value of 'key' based on the directory and name. I'll add an enhancement request to allow to override this default that will allow both plug-ins use the same 'key' to just load the file once.
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Confirm the dynamic action does not not as expected in the APEX 4.2.5
This looks like a bug in APEX 4.2.5. I have a page with a "Cancel" button that redirects to another page. There is a dynamic action that fires on the button with a confirmation action and the text ' are you sure? However, if the user selects OK or cancel in the confirmation dialog box makes no difference - the redirect is always performed.
I found this question after the migration of a page that worked to 4.1.1-to-4.2.5.00.88 APEX and were also able to replicate on apex.oracle.com here:
https://Apex.Oracle.com/pls/Apex/f?p=19896:2
(Press the Cancel button in the top right of the page redirects to page 1, regardless of the user's response to confirm the popup.)
I don't need someone to suggest the alternative code, I know how to build my own confirmation processing. I want to just raise this as a bug as possible and see if there is a solution to make the dynamic action works as it should.
NB I found this in the patch notes for 4.2.5.00.88 on a fix for a similar problem:
15984978
Dynamic action front-Submit with a confirmation message does not
Hi Tony,.
I think the problem is that the action of the button is defined as 'Redirect page in this Application', but it must always be "defined by the dynamic Action" as soon as you have set dynamic actions 'click' to a button. Normally, which is automatically changed as soon as you create your first dynamic action of a button, and I just confirmed by creating a test button in your application that has been defined as «Redirect...» ». After that I created a dynamic action the action of the button is set to "defined by the dynamic Action.
Is it possible that you have modified the action of the back button to «Reorient...» » ? The question why «redirect...» "does not work, it's that we cannot guarantee in what order the browser will process click on events defined with onclick in the tag button itself and those events attached as a click event handlers. This is why it is necessary that everything is defined as dynamic actions. Only in this case you will be able to cancel the treatment.
Concerning
Patrick
Member of the APEX development team
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf
Post edited by: Patrick Wolf
-
dynamic action + plug in to the right click.
Hi all
I installed a plug-in in my application of http://apex.oracle.com/pls/apex/f?p=1983:17:0: . and also, I created a dynamic action. but my questions are
now, my questions are,
1. how this plugin works for interactive report via a dynamic action only na?
2. If I want those right click menu options such as edit & discover - how to add?
3. If suppose I click on this edit/point of view, it should go to the appropriate page/report. -where and how to add these actions?
any help will be very useful for me
Thanks in advance.
you change function js like this:
function myMenuAction2 (Menu, el, pos)
{
If (Menu is 'page2')
{
Window.Location"http://apex.oracle.com/pls/apex/f?p=&APP_ID.:2: & APP_SESSION. » ;
}
on the other
{
Window.Location "http://www.google.com";
}}
-
Call a dynamic action automatically on a regular basis
Hello
We have a classic report which we would like to refresh that page every X minutes. We did this by using setInterval and $a_report but as I understand it, it is a unsupported feature... So I would go down the road of the dynamic action.
But my question is this... How can I call the dynamic action automatically say every 3 minutes, with no user interaction?Hello Dev,
You can use [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html] Plugin Timer
Best regards
Fateh
----------
If you believe that my answer is correct or helpful to you, then please check the response as helpful or appropriate. -
BUG? Presentation of elements via Dynamic Action in Internet Explorer generates "null."
I first noticed this using the newly improved apex.oracle.com. When I have dynamic action that must send the values of page element and the value is null / empty, the call to post/ajax result includes the literal 'null' as the value for this parameter.
for example
p_flow_id = 65928 & p_flow_step_id = 2110 p_instance = 574862348021401 & p_request = FLOW_PPR_OUTPUT_R1858426911545391_reset_R_1858426911545391 & p_arg_names = P2110_VENDOR1 & p_arg_names = P2110_VENDOR2 & p_arg_values = 3754 & p_arg_values = null
This only happens in Internet Explorer. I use IE9, but it seems to work that way, if I put it in IE8 mode as well.
I returned and tested in the Apex 4.1.1.00.23 and I got the same result.
GregHi Greg,.
Thanks again for the follow-up. You are right, it is the "Set Value" operation that causes the problem when it is called with a null value. In fact, it's a bug of IE underlaying.
See http://stackoverflow.com/questions/5387038/null-values-shown-in-form-fields-in-ie and also http://bugs.jquery.com/ticket/5163 strengthening jQuery
I will file a bug to use jQuery.val () workarounds to the problem.
Thank you
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Dynamic action - notification process success/error display
Hi people,
in our application, we have implemented a plugin of notification of the main Oracle apex site.
We want to use to display a message of success or error for the page processes. Success message is currently held by:
Q1: How to trigger a dynamic action that will call a message notification plugin?<div id="success-message" class="success">
Q2: How to complete a notification text with the text of the div with id = 'success message '?
Thank you very much
TomasSorting...
The problem is that you're using jQuery on the page loading code, but Jquery won't be available until jQuery is initializes (up to a certain number of milliseconds after the standard page load event)
$("#MESSAGE").val().length > 0
I changed it to use the APEX API, that works perfectly.
$v("MESSAGE").length > 0
-
How to cancel tasks in a dynamic Action when apex.confirm = cancel
I have a text field that has a dynamic Action attached to it. When the field is changed, the dynamic Action is triggered. There are 6 separate tasks in this dynamic Action.
The first task is a call to apex.confirm. I want to assure you that the user understand the consequences of the change in the value of this field. Thus, appears the dialog box, the user reads the information and decides to click OK or cancel.
If you click OK, I want to continue through the rest of the tasks in the dynamic Action. If you click CANCEL, I want to just give up out of dynamic Action.
Is this possible?
Apex 4.1.1.00.23
Published by: Mark T. March 1, 2012 09:49Hi Mark,
code, says more than words :-)
I changed your "apex.confirm" JavaScript code in action 'Confirm' that does what you want. The "apex.confirm" JavaScript API is not designed for what you want to do and how you used it.
The example works now in my opinion.
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
How to get the user input to dynamic Action confirmation message?
Hi guys,.
I use apex 4.1.
I added a page dynamic Action confirmation message box. How can I get the user input to the confirmation pop up?
Thank youHello
you do not directly get user input. But you should still be able to get what you want. Suppose you have a dynamic action which fires for a 'change' (or other) and who has two or more actions
(1) confirm
(2) execute the PL/SQL CodeIf the user clicks Cancel/no in the confirm dialog box, APEX stops execution of this dynamic action and not run "run the Code in PL/SQL.
Hope that helps
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Dynamic action - action sequence problem?
I have a button whose action is defined by a dynamic action.
Click on the button I want to do some pl/sql on the database, return a value in an item, and then open a url based on a value that is defined within this element.
I created a dynamic action (click on the button), having 2 real actions:
1. run pl/sql code - do some actions of database: generates a line in a table and return a value in an item (say p1_test)
2 run javascript - open source code is a url that uses a value stored in the p1_test item.
I have problem on the order of execution of these real measures: on click of a button, a new line is created in a table, the url is opened, but bad: the url address is incomplete, if I get an error that the p1_test element is not yet populated with the value.
After you open an error window, the element p1_test is filled with a correct value.
This is a problem. :( I need start by filling the value such that I defined by real action, and to open a url.
Can someone help me?
TNXHello Valentina,
using APEX 4.0 or 4.1 of the APEX?
(a) If you use APEX 4.0, you can use the "Set value" action after your action "run the Code in PL/SQL" to read the value stored in P1_TEST from the server and place it in the P1_TEST element in the browser.
(1) create an action 'Set value' with the type "PL/SQL Expression.
(2) the value of the expression of pl/sql:P1_TEST
(3) set P1_TEST as affected item.
The JavaScript code to use $v ('P1_TEST') to read the value.
(b) in the APEX 4.0 just use the 'Page return points' attribute of your "PL/SQL Execute Code" to return the value modified on the server to the client. If you set it to P1_TEST the modified value will automatically be returned to the browser.
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Dynamic action to set the value of the point of Application
Hello
I want to display a form button that sets a value of the point of Application. Can someone please help and guide how to proceed?
The requirement is, the user will receive a report, they can change a record and a button will allow him to SET the record for the session. When it accesses a different page within the application, they will see that the data relevant to the record that is DEFINED.
Thanks in advance
AaliHi, Estelle,.
You can use the dynamic action 'Code from PL/SQL Execute' to fix your application. For example, your code might look like
begin :G_DISPLAY_MODE := :P1_DISPLAY_MODE; end;
Page items to submit: P1_DISPLAY_MODE
P1_DISPLAY_MODE would be the element on your current page where you select the desired value.
Hope that you give something to play with.
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Simple dynamic action does work properly in 4.1 more
Our application has a page with a large number of boxes while using the same LOV ('Y', ' don't). We defined a simple and dynamic action that fires whenever the first box is changed. If its value is set to 'Y' the value of all the other checkboxes is set to 'Y' as well. A wrong action does the opposite. It worked well in 4.0. 4.1 it fires again, but instead of the complete list of the items affected only the first item in the list has its set value. When we change the action in "value"- for instance - 'hide' or 'Disable' it works fine once again (that is, affect the full list of items).
Anyone an idea what may be the problem here?
Robert.Hi Robert,.
I think you're hit "set of dynamic scripts 4.9 value with multiple affected elements ' documented as behavior change in the APEX 4.1 release notes http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21672/toc.htm#CACFHAFB at the same time Mark Lancaster also blogged about this a few days ago. http://oracleinsights.blogspot.com/2011/09/dynamic-actions-changed-behavior-in.html
BTW, if you have so many boxes O/N, you can take a look at our "Simple Checkbox" plugin to http://apex.oracle.com/plugins item type
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf
Maybe you are looking for
-
Camera works to the MAX, but not in LabVIEW
I struggled a lot with getting a camera DCC3240M of Thorlabs working in LabVIEW. The software supplied (Thorcam) works as it should. However, the LabVIEW SDK does not work as it should, it gives an error 155 "the operation is not supported. Instead o
-
What Sony blu ray models can be used to broadcast the NHL CenterIce package?
The enamel of the NHL, said that "readers from SONY smart blu ray" can broadcast live games in the NHL this year, not only the old games of proofreading that regular patterns can now. What models are 'smarter '? I looked and what I found is that they
-
I use NAWL Widows Live Mail get a mistake MATI when I try to send emails with attachments.
-
V470 blue tooth wireless mouse has stopped working
My Logitech v470 blue tooth mouse worked but stopped. I went online and downloaded the latest version of the software. The machine started to work. I used for1.5 days and on the second day, all of a sudden, it stopped working. All diagnoses that
-
Copied pictures on a computer using Windows XP Disc will not load on my laptop with Vista