Browsing "Older Posts"

Browsing Category "APEX issues"

Check inside your APEX application if debug mode is enabled

Von Tobias Arnhold → 6.08.2018
Sounds like a simple task but whenever I have the requirement to add a region and make it conditional to check if APEX is running in debug mode. I always search for half an hour finding the right solution.

Search example on Google: "Oracle APEX check debug mode conditional PL/SQL"
Trying this or 30 different other ways it always ends up with the wrong results.

But it is so easy - Conditional PL/SQL Expression:
APEX_APPLICATION.G_DEBUG

G_DEBUG returns true or false!
The documentation is a bit imprecise because it says 'Yes' or 'No'.

Anyway it is all well documented in the APEX documentation
> APEX_APPLICATION > Global Variables:
https://docs.oracle.com/database/apex-18.1/AEAPI/Global-Variables.htm#AEAPI29544




APEX 5 - File Upload Bug

Von Tobias Arnhold → 2.18.2016
Today I had to suffer on a real APEX 5 bug.

When you upload a file the NLS settings in your current APEX session will be set to AMERICAN.
I check for issues like that and found a forum post where someone else was experiencing the same problems as I did:
File browse changes some NLS settings - possible bug

My purpose was to upload a CSV file and transforming it to table data. Now I couldn't handle NUMBER values anymore. I always experienced the following error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error

APEX 5 Migration - Part 3 - The Universal Theme Migration

Von Tobias Arnhold → 1.12.2016
The last part of my APEX 5 migrations series:

- APEX 5 Migration - Part 1 - Requirements and Installation
- APEX 5 Migration - Part 2 - Common application issues after the migration
 
This part is about the best and hardest migration:
The Universal Theme migration (UT)!

Most of the developers love the new theme and its functionality but what makes it so different to the old ones? What is the value of the extra costs for the UT migration? Which rules should be followed? And what are the most common problems you will have to face?

Page Designer bug in combination with APEX plugin settings

Von Tobias Arnhold → 10.28.2015
Yesterday evening I struggled with a strange issue inside the Page Designer.

One APEX application created on each page of the Page Designer the following javascript parsing error:

Error: parsererror - SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

It only happened in 1 of several applications I currently check after an APEX 5.0.2 migration.

What I did to find the issue (Thanks to Denes for some really good tips):
 - Copied the application into a new ID --> error could be reproduced
 - I dropped every page in the application --> error still occurred
 - My application had only one new empty page (page 1) and I switched to Universal Theme --> error still occurred
 - I checked several "Supporting Objects" and found the issue in one plugin
   - After deleting the plugin the parsing error disappeared
   - Unfortunately this plugin was referenced in 8 pages so I looked deeper into it
 - The issue was a wrongly referenced "Label appearance"



 - After I changed the setting to "- Not Depending -" the Page Designer run as expected

jQuery dialog z-index problem after migrating to APEX 5

Von Tobias Arnhold →
After migrating an APEX 4 application to APEX 5.0.2 I got an issue with the plugin called "Dialog Region".


The modal dialog wasn't accessible because the overlay effect was on top of my dialog.

Luckily some CSS code fixed the issue:

body div.ui-widget-overlay {
    z-index: 1;
}


The issue comes from the plugin in combination with an old theme. Actually it is easy to fix and no reason not to upgrade to APEX 5.0.2. :)

-----------------------------------------------------------------------------------------------------------------------------------

Btw.: The return to page function don't work in the "edit page" view.

APEX 4.2.5 Tabular Form - Komischer Bug

Von Tobias Arnhold → 2.27.2015
In einem meiner Projekte habe ich etwas intensiver auf Tabular Forms gesetzt.

In gewissen Konstellationen habe ich immer wieder folgende Meldung nach einem Validierungsfehler erhalten:
Aktuelle Daten für tabulare Forms sind zu alt; die Quelldaten wurden geändert.
Klicken Sie hier, um Ihre Änderungen zu verwerfen und die Daten aus der Datenbank neu zu laden.


Eventuell auch in Englisch:
Current tabular form data is too old; the source data has been modified.
Click here to discard your changes and reload the data from the database.


Direkt kam mir der Gedanke mit der Sprache und der Number-Spalte (., Setzung). Habe auch danach gesucht:
https://community.oracle.com/thread/2458512

Aber mein Fehler hatte nix mit der Sprache zu tun, sondern lag an einem Unique Constraint.
https://community.oracle.com/thread/2143396

Sobald ich diesen gelöscht habe, gab es dieses Phänomen nicht mehr! Habe ich Ihn wieder hinzugefügt, so habe ich den Fehler direkt wieder erhalten. :(




APEX Anwendungen importieren und exportieren mit Hilfe des SQL Developers

Von Tobias Arnhold → 2.20.2015
Wussten Sie das der Oracle SQL Developer eine sehr gute APEX Integration bietet? Ich möchte dies Anhand der Import und Export Fähigkeit näher demonstrieren.

Im SQL Developer gibt es im Navigationsmenü neben den üblichen Verdächtigen (Tabellen, Funktionen, Triggern, ...) auch einen Punkt Namens: Application Express
Wenn Sie diesen öffnen, dann sehen Sie alle installierten APEX Anwendungen die auf das Schema referenziert sind.

Export
Über die Rechte Maustaste > Schnell-DDL > In Datei schreiben... können Sie die Anwendung exportieren.

Import
Rechte Maustaste auf Application Express, anschließend "Anwendung importieren..." auswählen. 
 Natürlich können Sie auch im SQL Developer alle Installations-Optionen wie in APEX mitgeben.
Und nun kommt etwas Neues!
Wenn die Installation gestartet ist, dann können Sie die komplette Installation im Log nachverfolgen.

Diese Info hat mir schon einmal mehrere Stunden Suche gespart. Denn falls Sie es hin bekommen eine APEX Anwendung zu zerstören, so dass der Import nicht mehr funktioniert. Können Sie mit Hilfe des SQL Developer's die genaue Stelle des Fehlers herausfinden und anschließend die Anwendung korrigieren und erneut exportieren.
APEX-AT-WORK no image

Scroll to the top of your page/report

Von Tobias Arnhold → 1.19.2014
In case you use partial page refresh inside your reports you may have encountered an issue that you always stay on the bottom of the page even after the refresh of the report.  One of my customer marked this as a bug and meant that after the refresh the display position should be at the beginning of the report.

Seems complicated but worked out to be really easy:
Add a dynamic action: After refresh of your report execute this javascript statement

/* Scroll to Top */
$("html, body").animate({ scrollTop: 0 }, 0);

or in case you have the exact position of your report:
/* Scroll to the beginning of the report, starts at 221 */
$("html, body").animate({ scrollTop: 221 }, 0);

I found the solution in this post:
http://stackoverflow.com/questions/1144805/how-do-i-scroll-to-the-top-of-the-page-with-jquery

Working with multiple browser tabs

Von Tobias Arnhold → 12.10.2013
When I develop APEX applications I use several browser tabs to navigate between the executed application and the application builder. There is one side affect which drives me crazy sometimes.

TAB 1: Executed application
TAB 2: Application Builder

How do I work?
I edit an item inside the application builder (for example the LOV select statement) and click on save. I immediately change the TAB and press F5 to update the application.

What drives me crazy?
If I have made a mistake in the select statement of my LOV I just get a error message inside the browser page. But I changed the TAB faster then the result appeared and I didn't recognize it.

It would be great if the TAB title would have changed too. So that I could see that an error occurred.



Update 12.12.2013:
New APEX feature request added on: apex.oracle.com/vote
ID: AIRU
Text: Browser TAB error message


APEX-AT-WORK no image

Automatic language detection bug in APEX 4.2.1

Von Tobias Arnhold → 2.12.2013
I already posted a forum entry to the topic but no one had answered yet. I think the bug is a real problem so people should know about it:
https://forums.oracle.com/forums/message.jspa?messageID=10840734#10840734

Here are the details:
Automatic browser language detection can not be used in APEX applications during their runtime.

In the environment I'm working at the moment we are developing mostly German applications but database standard character set is this:
SELECT * FROM NLS_DATABASE_PARAMETERS

Parameter Value
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8ISO8859P15
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN


All applications are set up with "Globalization Attributes":
 Application Primary Language: German
 Application Language Derived From: Browser (use browser language preference)
 Application Date Format: DD.MM.YYYY


Default behavior should be:

In all former versions of APEX it changes the default settings from the database to the browser settings.
An now:
In the current version it does NOT change the language.

For example: 
APEX 4.1 displays number values like that
10.000,00

APEX 4.2.1 displays number values like that
10,000.00

If I check the debug log I find this:
0.04096 0.00016 S H O W: application="101" page="16" workspace="" request="" session="16485344217862" 4 
0.04110 0.00044 Reset NLS settings 4 
0.04155 0.00020 alter session set NLS_LANGUAGE="AMERICAN" 4 
0.04174 0.00016 alter session set NLS_TERRITORY="AMERICA" 4 
0.04189 0.00014 alter session set NLS_CALENDAR="GREGORIAN" 4 
0.04203 0.00014 alter session set NLS_SORT="BINARY" 4 
0.04217 0.00017 alter session set NLS_COMP="BINARY" 4 
0.04234 0.00003 ...NLS: Set Decimal separator="." 4 
0.04237 0.00014 ...NLS: Set NLS Group separator="," 4 
0.04251 0.00013 ...NLS: Set g_nls_date_format="DD-MON-RR" 4 
0.04264 0.00013 ...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM" 4 
0.04277 0.00032 ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR" 4 
0.04309 0.00005 NLS of database and client differs, characterset conversion needed 4 
0.04314 0.00257 ...Setting session time_zone to +01:00 4 
0.04572 0.00005 NLS: Language=       

As you see the default language is set to: NLS_LANGUAGE = "AMERICAN"
But now the second task should be to switch the language to German but this doesn't happen. Log file shows action with an empty value: NLS: Language= #empty#
 
Issue happens in all browsers: FF, Chrome, IE

Somebody else had similar issues as I did:
https://forums.oracle.com/forums/thread.jspa?threadID=2477036&tstart=0

Hope some in the APEX universe can help me here?

Thanks

Check-box bug in tabular form

Von Tobias Arnhold → 9.17.2012
I don't know if this is a environment problem or a general one. Anyway it is mad and took me a long while to find out what it is.
Here we go:
 - I have a tabular form with standard APEX processing.
 - The tabular form includes a single check-box column with y,n
 - The check-box column is conditional



As you can see the condition will always execute. And so it does. My column is perfectly displayed on my page.

Problem/Bug:
Now whenever I try to save my changes. Nothing happens. The "Mulit Row Update"-Process does not get executed.
After some analyzing I found out that there were no more hidden elements for the tabular form created. APEX just didn't know what to save.

If I take the conditional display away it works fine.
As you see those marked input elements disappear with the conditional single checkbox.

Current environment:
We use Application Express 4.1.0.00.32

Is this a known bug? Have you ever experienced something like that?

Update
After some more investigation and a good hint from a colleague I found the real reason.
What I didn't mentioned: All columns where conditional and in that case APEX doesn't know where to add the hidden elements. I made another column unconditional and it worked (even with my conditional single check box).
Good to know! :)

IR Bug after import of an application with new id

Von Tobias Arnhold → 8.07.2012
Today I discovered a really cruel bug in APEX.
We migrated an APEX 4.0 application into a new workspace with APEX 4.1.
The application got a new application id. The application used a lot of interactive reports. Some of the report columns where created as "Display as Text (based on LOV, escape special characters)".
After the import all LOV assignments where dropped.

Did anyone else discovered the same issue? Is there any bug fix planned in a newer version of APEX. 
In the new workspace we use version 4.1.0.00.32.

Difficult use of BI Publisher inside APEX

Von Tobias Arnhold → 2.08.2012
Are you using BI Publisher inside APEX? Do you have a lot of "Report Layouts" inside your application? Did ever need to update them? If yes, then you know about the issue. You can't update a RTF template file. You need to delete it and create a new one. Afterwards you need to reset the "Report Query".
You find the BI Publisher integration under Shared Components > Report > Report Layouts
You don't have any update button inside this mask.  

APEX mentioned the following standard way to proceed:
Named column report layouts are file based. To change, download the current file using the download button on this page, then modify the file as needed. Afterwards, upload the modified file as a new report layout.  

There are still problems left:
1. If you just create new file, you will need to assign it to your "Report Query".
2. After you assigned the new template, the old one needs to be deleted or you get a mess of templates.  

Recommendation:
Please APEX-Team make those files update-able. It would make the developer life much easier.
APEX-AT-WORK no image

Image Slider Plugin

Von Tobias Arnhold → 1.11.2012
I'm currently working on a new plug-in based on the jQuery Plug-in S3Slider.

At the moment the plug-in is still under development:
http://apex.oracle.com/pls/otn/f?p=65560:12

It will be a region plug-in where you only set the selection and the options and it will create the nice slider solution on your APEX page. As template I use the cloud plug-in from Carsten Czarski.

The plug-in will be used as an example for a magazine article I will write in the next days.

Looking for UILayout plug-in beta tester (APEX 4.1 only)

Von Tobias Arnhold → 10.17.2011
I added some fixes to the UILayout plug-in in combination with APEX 4.1 and the Interactive Report appearance.

I'm quite busy with the Plugin App and looking out for some testers. If there is anybody out there then please contact me.

The following issues are fixed under APEX 4.1:

Format options position
Rows Per Page position
Column options

I don't know if it works for all themes? If you know about more issues or even have some improvement ideas please inform me. I will fix it before the final release will come out.

Tobias
APEX-AT-WORK no image

Automatic File Upload filename can't be null

Von Tobias Arnhold → 8.30.2011
I used the automatic file upload feature of APEX and got always an error that either filename or mimetype column of my file table can't be null.

APEX probably saves first in FLOW_FILES and then updates my tables. If I take the column "NOT NULL" limitation away it works fine.

If you want to know how you configure automatic file upload in APEX look here:
File Browser in APEX 4 with BLOB column specified in item source attribute
APEX-AT-WORK no image

IRR: UILayout issue

Von Tobias Arnhold → 8.17.2011
If you use the UILayout plug-in for APEX with Interactive Reports you will see some issues inside the action menu. The "Rows Per Page" and the "Format" menu will be positioned above the main action menu.

To fix this use the following js snippet with a dynamic action or add it inside your page header:
$('.dhtmlSubMenuS').mouseover(function() {

  $('#apexir_ROWS_PER_PAGE_MENU').css({

    left: $('#apexir_ROWS_PER_PAGE_MENU').position().left + 200 + "px"

  });

  $('#apexir_FORMAT_MENU').css({

    left: $('#apexir_FORMAT_MENU').position().left + 200 + "px"

  });    

});


Create a Dynamic Action which fires on the refresh of your Interactive Report and executes the JS code. Run it also on page load.

I will fix it in one of the next versions of the plug-in.
APEX-AT-WORK no image

New Plug-in: Hyphenation for APEX

Von Tobias Arnhold → 7.02.2011
I just released a new plug-in called: Hyphenation for APEX

Unfortunately at the moment it seems only to work with Firefox. I contacted the developers of the original plug-in to find the issue why it doesn't work with IE9 and the standard APEX theme?

Check out this ticket for more information: http://code.google.com/p/hyphenator/issues/detail?id=146

I will update the plug-in as soon as I have a solution.
APEX-AT-WORK no image

ORA-00001, WWV_FLOW_DATA_IDX1, ERR-1029

Von Tobias Arnhold → 4.13.2011
Troubleshooting the following APEX error:

ORA-00001: unique constraint (APEX_040000.WWV_FLOW_DATA_IDX1) violated
ERR-1029 Speichern von Sessioninformationen nicht möglich. session=3642920897355064 item=9815904291046405

This issue often comes in combination with iFrames, item computations, different languages or collections.

First you need to find which item is effected:

Inside APEX Application Builder > Application xxx > Utilities > Application Express Views > APEX_APPLICATION_PAGE_ITEMS
Columns: Select all columns
Filter: Item_ID = 9815904291046405
Copy the generated select and execute it inside your SQL Developer:

select WORKSPACE,APPLICATION_ID,APPLICATION_NAME,PAGE_ID,PAGE_NAME,ITEM_NAME,DISPLAY_AS,DISPLAY_AS_CODE,ITEM_DATA_TYPE,IS_REQUIRED,STANDARD_VALIDATIONS,DISPLAY_SEQUENCE,REGION,REGION_ID,SOURCE_USED,ITEM_DEFAULT,ITEM_DEFAULT_TYPE,LABEL,PRE_ELEMENT_TEXT,POST_ELEMENT_TEXT,FORMAT_MASK,ITEM_LABEL_TEMPLATE,ITEM_LABEL_TEMPLATE_ID,ITEM_SOURCE,ITEM_SOURCE_TYPE,ENCRYPT_SESSION_STATE,SOURCE_POST_COMPUTATION,READ_ONLY_CONDITION_TYPE,READ_ONLY_CONDITION_EXP1,READ_ONLY_CONDITION_EXP2,READ_ONLY_DISPLAY_ATTR,LOV_NAMED_LOV,LOV_DEFINITION,LOV_DISPLAY_EXTRA,LOV_DISPLAY_NULL,LOV_NULL_TEXT,LOV_NULL_VALUE,LOV_QUERY_RESULT_TRANSLATED,LOV_CASCADE_PARENT_ITEMS,AJAX_ITEMS_TO_SUBMIT,AJAX_OPTIMIZE_REFRESH,ITEM_ELEMENT_WIDTH,ITEM_ELEMENT_MAX_LENGTH,ITEM_ELEMENT_HEIGHT,HTML_TABLE_CELL_ATTR_LABEL,HTML_TABLE_CELL_ATTR_ELEMENT,HTML_FORM_ELEMENT_ATTRIBUTES,FORM_ELEMENT_OPTION_ATTRIBUTES,ITEM_BUTTON_IMAGE,ITEM_BUTTON_IMAGE_ATTRIBUTES,BEGINS_ON_NEW_ROW,BEGINS_ON_NEW_CELL,COLUMN_SPAN,ROW_SPAN,LABEL_ALIGNMENT,ITEM_ALIGNMENT,SHOW_QUICK_PICKS,QUICK_PICK_LINK_ATTR,QUICK_PICK_LABEL_01,QUICK_PICK_VALUE_01,QUICK_PICK_LABEL_02,QUICK_PICK_VALUE_02,QUICK_PICK_LABEL_03,QUICK_PICK_VALUE_03,QUICK_PICK_LABEL_04,QUICK_PICK_VALUE_04,QUICK_PICK_LABEL_05,QUICK_PICK_VALUE_05,QUICK_PICK_LABEL_06,QUICK_PICK_VALUE_06,QUICK_PICK_LABEL_07,QUICK_PICK_VALUE_07,QUICK_PICK_LABEL_08,QUICK_PICK_VALUE_08,QUICK_PICK_LABEL_09,QUICK_PICK_VALUE_09,QUICK_PICK_LABEL_10,QUICK_PICK_VALUE_10,ATTRIBUTE_01,ATTRIBUTE_02,ATTRIBUTE_03,ATTRIBUTE_04,ATTRIBUTE_05,ATTRIBUTE_06,ATTRIBUTE_07,ATTRIBUTE_08,ATTRIBUTE_09,ATTRIBUTE_10,CONDITION_TYPE,CONDITION_EXPRESSION1,CONDITION_EXPRESSION2,MAINTAIN_SESSION_STATE,ITEM_PROTECTION_LEVEL,ESCAPE_ON_HTTP_OUTPUT,AUTHORIZATION_SCHEME,AUTHORIZATION_SCHEME_ID,BUILD_OPTION,BUILD_OPTION_ID,ITEM_HELP_TEXT,LAST_UPDATED_BY,LAST_UPDATED_ON,COMPONENT_COMMENT,ITEM_ID,COMPONENT_SIGNATURE
from APEX_APPLICATION_PAGE_ITEMS
where ITEM_ID = 9815904291046405


Investigate the effected item... You may find strange connections to other APEX components?

Forum entry: http://forums.oracle.com/forums/thread.jspa?messageID=9365663
APEX-AT-WORK no image

Handling the 32k problem in APEX charts

Von Tobias Arnhold → 4.03.2011
How to handle more then 32k (32768) characters inside your APEX charts: AnyChart gantt with custom xml and more then 32k

Workaround:

- Create your own chart

Info:
- AnyChart documentation: Set XML As String From TextArea

HTML Header:http://www.blogger.com/img/blank.gif

<script src="#APP_IMAGES#anychart_intkit.js" language="javascript"></script>

PL/SQL Region:

/* ... */
htp.p('<textarea cols="65" rows="17" id="rowData" style="display:none;">');

/* Write CLOB through a package function */
P_CLOB := MY_PACKAGE.F_APEX_GANTT_COMPLETE ( P_USER );

dbms_lob.open(P_CLOB, dbms_lob.lob_readonly);

P_LENGTH := dbms_lob.getlength (P_CLOB);

while P_LENGTH > 0 loop

/* Read 32000 characters from CLOB */
dbms_lob.read(P_CLOB, P_CLOB_BUFFER, P_POS, P_SET);

/* Write code in APEX */
htp.prn(P_SET);

/* Increase Counter */
P_POS := P_POS + P_CLOB_BUFFER;
P_LOOP := P_LOOP + 1;

/* Resize CLOB length */
P_LENGTH := P_LENGTH - P_CLOB_BUFFER;

end loop;

dbms_lob.close(P_CLOB);

htp.p('</textarea>');
htp.p('<div id="chartDiv"></div>');

htp.p(
'<script type="text/javascript" language="javascript">' || chr(10) ||
'/* Set default swf path */' || chr(10) ||
'AnyChart.swfFile = ''/i/flashchart/anygantt_4/swf/AnyGantt.swf'';' || chr(10) ||
'/* Create new gantt chart */' || chr(10) ||
'var chart = new AnyChart();' || chr(10) ||
'chart.width="2500";' || chr(10) ||
'chart.height="1400";' || chr(10) ||
'/* Get string data from text area */' || chr(10) ||
'var data = document.getElementById(''rowData'').value.toString();' || chr(10) ||
'/* Set data */' || chr(10) ||
'chart.setData(data);' || chr(10) ||
'/* Write chart to "chart" div */' || chr(10) ||
'chart.write("chartDiv");' || chr(10) ||
'</script>');
/* ... */


I created a region plug-in based on the above code to handle the huge charts! :)