Application 105 Dialog page 11 cannot be rendered successfully - oracle-apex-19.1

Oracle Apex application:
I'm trying to redirect to another page by javascript, but the following error appears:
"Application 105 Dialog page 11 cannot be rendered successfully.
Ensure the page template in use on page 11 is of template type "Dialog page",
with appropriate JavaScript dialog initialization, dialog closure and dialog
cancel code defined."
Here is my code:
function openPopup (P10_IN) {
var url;
url = 'f?p=105:11:5992241694125::::P11_IN:'+P10_IN ;
w = open(url);
}

You probably have set the page you want to redirect to as Appearance - Page Mode: "Modal Dialog".
Set it to Appearance - Page Mode: "Normal" and it should work as you expect.

Related

Gui admin button to make a form have additional features

I created a GUI with a button in PowerShell. If user presses this button a popup window will appear and ask for a password. If the password was 123, then the GUI should be reloaded with some extra options.
I wrote the following function for this button:
Function AdminPanelPass() {
if ($TextBox91.Text -eq $adminpanelpass) {
$script:admin = 1
$form9.Dispose()
$script:form.Dispose()
[void]$script:form.ShowDialog()
}
}
This function is called if the button is pressed. It reads the password from the TextBox91 on the form9. If the password was not 123, form9 is closed and after that the main form will be reloaded. Upon reloading the main form there is a check for $admin.
The problem is that after the form is closed, it won't open again. The error is:
Exception calling "ShowDialog" with "0" argument(s): "Form that is
already displayed modally cannot be displayed as a modal dialog box.
Close the form before calling showDialog."
Can anyone assist please? Is that a correct way to be doing such a thing?
Found a way it works:
Function AdminPanelPass(){
if ($TextBox91.Text -eq $adminpanelpass){
$script:admin = 1
$form9.Dispose()
$form.Dispose()
MakeForm
}
}
MakeForm is the function to create the main form

Confirmation before closing a modal dialog page in Apex 5.0

I am trying to create a simple confirmation ("Do you want to close this window?") when closing a modal dialog page with the (X)-button.
What would be the most efficient way to implement this in Apex 5.0?
I tried to implement a solution using the dialog closed event, this seemed to have had no effects on closing the dialog with the (X)-button, however.
Try to create a dynamic action, on page load, in your modal page with that code:
Your da should execute a javascript code:
var button = parent.$('.ui-dialog-titlebar-close'); //get the button
button.unbind(); //remove the behavior
//put another behavior to the button
button.on('click', function() {
apex.message.confirm( "Your message here", function( okPressed ) {
if( okPressed ) {
apex.navigation.dialog.cancel(true);
}
});
});
Try to confirm if the "X" button have the css class "ui-dialog-titlebar-close", they can change between versions of apex.
If necessary, update the first line of the code with the correct class.
Have you considered hiding the button (x) and canceling the modal dialog page by clicking on the "cancel" button?
If you want to rename the standard button names in the confirmation window, use:
apex.lang.addMessages({"APEX.DIALOG.OK": pOkLabel});
apex.lang.addMessages({"APEX.DIALOG.CANCEL": pCancelLabel});

CKEditor - Trigger dialog ok button

I'm using CKEditor and I wrote a plugin that pops up a the CKEditor dialog.
I need to re design the ok button and add to the footer more elements like textbox and checkbox but it's seems to be to complicated to do so, so I've hide the footer part and created a uiElement in the dialog content with all what I need but now what I want is to trigger the okButton in the hidden footer but I can't find a way to do it..
Anyone?!
There may be a better way, but here's how I'm doing it:
var ckDialog = window.CKEDITOR.dialog.getCurrent(),
ckCancel = ckDialog._.buttons['cancel'],
ckOk = ckDialog._.buttons['ok'];
ckOK.click();
The trick is to get the button and then use the CKEditor Button API to simulate the click. For some reason, I was unable to call dialog.getButton('ok') because getButton is undefined for some reason. My method digs into the private data, which I doubt is the best way to do it.
From the onShow event (when defining the dialog), I was able to get the ok button like the docs indicate:
onShow: function () {
var okBtn = this.getButton('ok');
...
}
Here's the Button API: http://docs.ckeditor.com/#!/api/CKEDITOR.ui.dialog.button, and you can access the dialog API there too (I'm assuming you've already been there!!!)
You might try to add this line in your plugin.js.
var dialog = this.getDialog();
document.getElementById(dialog.getButton('ok').domId).click();
In my custom plugin, i just hide the "ok" button instead of the whole footer.
Below is a part of my plugin.js statements.
{
type : 'fileButton',
id : 'uploadButton',
label : 'Upload file',
'for' : [ 'tab1', 'upload' ],
filebrowser :
{
action : 'QuickUpload',
onSelect : function(fileUrl, data){
var dialog = this.getDialog();
dialog.getContentElement('tab1','urlTxt').setValue(fileUrl);
document.getElementById(dialog.getButton('ok').domId).click();
}
}
}
btw, i'm using CKEditor 4.0 (revision 769d96134b)

Setting the type of a button, ie8

Creating a button dynamically and then trying to set it to be a button rather then the default submit.
Here is how I am creating the button and setting the type.
var pickButton = document.createElement("button");
pickButton.type = "button";
IE8 will error out, saying:
SCRIPT445: Object doesn't support this action
Use:
pickButton.setAttribute('type', 'button');

Dojo: Dialog refreshing a dojox.layout.ContentPane in a TabContainer

I have a problem with Dojo in Internet explorer 7/8 (this works fine in Firefox).
Basically I have a tab container with a number of tabs in it (these are dojox.layout.ContentPane's). On one of these tabs I want to have a "comments box" which would popup a dialog and ask the user to put something in. The comment is then saved by an call to the back end and I want the tab to reload to show the new comment.
The logic of my save button works something like this:
<button data-dojo-type="dijit.form.Button" type="button" data-dojo-props="iconClass:'dijitIcon dijitIconSave', showLabel: true" title="Add your comment">Add Comment
<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
require(["dojo/dom"], function(dom)
{
var tText = dijit.byId('comment_70').get('value');
if (tText == '')
{
alert('You have not entered any comment');
return;
}
var tJSONRPC = new JSONRpcClient('JSON-RPC');
try
{
tJSONRPC.be.addComment('70', tText);
var tTab = dijit.byId('Detail_70');
tTab.refresh();
}
catch (Ex)
{
alert(Ex);
}
});
</script></button>
Does not appear to be terrible taxing (the 70 at the end is the ID so that the user can have more than one of these open at the same time, hence the tabs).
As mentioned this works fine in Firefox but not in IE 8/7, it throws an error in some of the generated code within dojo (_32.focus(); to be precise), the error message I get in the debug console is "Unexpected call to method or property access"
Try this, with your line tTab.refresh();:
setTimeout(function() { tTab.refresh(); }, 0); // whenIdle
Its nearly impossible to tell where the thrown exception comes from - you should use the developement dojo-1.M.m-src/dojo/dojo.js code so optimized function- and variable-names are expanded (along with useful commenting once you step-through-debug).
Reason for the above is to eliminate, that exception occurs while handling button onclick-focus event (refresh will tear down DOM in the tab - along with your button)

Resources