We are currently using APEX 4.2, and according to the oracle docs the URL syntax for linking to pages is as follows:
Comma-delimited list of item names used to set session state with a URL.
List of item values used to set session state within a URL. Item values cannot include colons, but can contain commas if enclosed with backslashes. To pass a comma in an item value, enclose the characters with backslashes. For example:
In my case, I need to pass a premise(99999), service type(Electric), channel(1), start date(24-AUG-2014 00:00), and an end date(25-AUG-2014 00:00) value in the url.
You'll notice that APEX encodes the spaces with %20.
The problem is that any colon after the last item (itemNames) is treated as an item delimiter! So, the first date value of 24-AUG-2014 00:00 gets passed to page 4 as 24-AUG-2014 (no time) and the rest of the itemValues are ignored (25-AUG-2014 00:00 is not passed at all).
Hmm. So Apex escapes the spaces but not the "non delimiting colons". So I try to manually manipulate the URL to encode the colons with %3A:
No dice, same result as before with the escaped colon still being treated as a delimiter. This means that using utl_https.escape on the second half of the URL would not work. As a matter of fact it was worse as I would pass escaped characters to apex when building my URL and APEX would re-escape them on transmission(escape the % signs for example).
I do some googling around and see lots of activity on the subject with some folks hinting around at substituting the colons and spaces prior to passing to the new page, then replacing the values with spaces and colons. So I decided to write a function to do this.
CREATE OR REPLACE FUNCTION AMFC.escape_url (V_URL_BASE VARCHAR2,
encoded_url VARCHAR2 (4000);
|| replace(replace (v_url_suffix,' ','_SPACE_'),':','_COLON_');
I then call this function from my series sql to populate the link column and set the
Here is what the URL that gets passed to page 4 looks like now. You'll notice that all of the colons and spaces have been replaced on the second part of the URL (variable values) only as a result of the function call.
Since there are no colons being treated as delimeters, these values make it to their destination items on page 4.
The next step was to decode the values of _SPACE_ and _COLON_ to their correct values before the loading of the regions page 4.
I created two computations to handle this task:
Each computations is the same with the exception of the item referenced in the code. Here is P4_START_DATE: