English 中文(简体)
How do I create a manual link on a tree in Oracle APEX when Session State Protection is turned on?
原标题:

Friends,

I m facing another challenge in APEX and I hope you can help.

I have created a tree using the method described in John & Scott s superb book, "Pro Application Express" whereby the page link is stored in a table. Below is an example:

go to a page passing some parameters

f?p=&APP_ID.:3:&SESSION.::::P3_IDENTIFIER,P3_FAMILY_NAME:&P2_IDENTIFIER.,&P2_FAMILY_NAME.

When the page is run this works as expected. I can expand the tree and navigate to the page passing parameters if required.

However when I turned on session state protection these "hand crafted" links stopped working. Which I expected because the link contains no checksum.

After some investigation I see I have to use APEX_UTIL.PREPARE_URL to generate the URL with a checksum. Unfortunately this is where I run into problems. I can t seem to be able to pass the parameters values to the calling page.

The original tree query was:

select "IDENTIFIER" id,
"PARENT_IDENTIFIER" pid,
"TITLE" name,
"LINK" link,
null a1,
null a2
from <some table>

I then changed this to use APEX_UTIL.PREPARE_URL:

....
APEX_UTIL.PREPARE_URL( f?p= ||:APP_ID|| :3: ||:APP_SESSION|| ::::P3_IDENTIFIER,P3_FAMILY_NAME:&P2_IDENTIFIER.,&P2_FAMILY_NAME. ) link,
...

and this works, the page is called and I can see the values of the parameters passed. But I can t use this method as it is restricted to the one page!

Finally I tried storing the page number, parameters and parameter values in different columns of the table that the tree is based on and then bring them together:

...
APEX_UTIL.PREPARE_URL( f?p= ||:APP_ID|| : ||navigate_to_page|| : ||:APP_SESSION|| :::: ||parameters|| : ||parameter_values) link,
...

Where: 

navigate to page has the value of: 3
parameters has the value of: P3_IDENTIFIER,P3_FAMILY_NAME
parameter_values has the values of: &P2_IDENTIFIER.,&P2_FAMILY_NAME.

This now calls the page, but the parameter values have become literals. so where I m expecting an identifier I see &P2_IDENTIFIER and ditto for family name.

What am I doing wrong? How can I pass values to my called page using apex_util_prepare_url?

In case of need, my environment details are: Apex 3.2.1, Oracle Application Server 10.1.2.3. Oracle Database 10.2.0.3

Thanks in advance for any help you may be able to provide.

最佳回答

I think you ll need to resolve those variables, using the v() function:

APEX_UTIL.PREPARE_URL( f?p= ||:APP_ID
|| : ||navigate_to_page
|| : ||:APP_SESSION
|| :::: ||parameters
|| : ||v( P2_IDENTIFIER )|| , ||v( P2_FAMILY_NAME )) link,

On a side note, you might need to be careful about P2_FAMILY_NAME since it s being used in the url; it sounds like a plain text field which contains user-entered data?

问题回答

暂无回答




相关问题
Oracle10g XE: Why PLS_INTEGER cannot be a column type

An invalid datatype is returned when I issue following command: CREATE TABLE msg_info ( msgcode PLS_INTEGER, msgtype VARCHAR2(30), msgtext VARCHAR2(2000), msgname VARCHAR2(30), ...

DMBS_SQL.to_refcursor equivalent in Oracle 10g

I have a coworker who came across DBMS_SQL.to_refcursor which would be a great solution for him to pass back the refcursor he needs, however we are running Oracle 10g and this feature is only ...

难以执行 REGEXP_SUBSTR

I m 查询Oracle 10g。 我有两张表格(样本数据见下文)。 i m 试图提取一些领域

Oracle: LONG RAW to?

I am writing a program in java where I need to create a copy of a table (without data). for that I am using the following query CREATE TABLE NEW_TABLE AS SELECT * FROM OLD_TABLE I have come across a ...

Oracle REPLACE function - unsure how to use for my scenario

I have a column called THE_VALUE in a table TABLE_A, that holds data similar to the following, i.e a few sample rows might be: tom:harry, sally, jeff state(vic,nsw), england, qwerty(aaa,bbb, cccc):...

热门标签