Oracle APEX 在页面直接传递参数值

例子一:

It's easy to understand the contents of a APEX URL.  The APEX documentation shows an example of passing values between screens:

Passing a single item in APEX

It clears existing information and sets the item's value (typically a primary key).

f?p=6000:6003:&SESSION.::NO:6003:MY_ITEM:1234 

Specifically this example:

  • Runs page 6003 of application 6000 and use the current session ID

  • Indicates to not show debug information (NO)

  • Clears all values maintained by the current session's cache for items on page 6003

  • Sets the session state of an item called MY_ITEM to the value 1234

Passing multiple screen values in APEX

This example is similar to the previous one except it passes values to multiple items.

f?p=6000:6004:&SESSION.::NO:6003:MY_ITEM1,MY_ITEM2,MY_ITEM3:1234,,5678 

Specifically this example:

  • Runs page 6004 of application 6000 and use the current session ID

  • Clears the current session's cache for items on page 6003

  • Indicates debug information should be hidden (NO)

  • Sets the value of MY_ITEM1 to 1234, sets the value of MY_ITEM2 to null (indicated by the commas used as placeholder), and set the value of MY_ITEM3 to 5678

The Oracle APEX Users guide shows how APEX passes literal literal values, a potential security threat unless you implement proper APEX security policies.

Our example of passing variables between screens

Now let's try this with other examples of passing screen values in APEX.  In our example we pass a flight_key value to a new screen numbered 666:

f?p=&APP_ID.:666:&SESSION.:6600:&DEBUG.::FLIGHT_KEY,flight_nbr:#FLIGHT_KEY#

We can also specify the values in the APEX link atribute screen, in this case we pass two values, flight_sched and flight_nbr to the destination screen, page 66:



Displaying values on the destination APEX screen

To verify that the values have been passed we go to the destination screen and create a display item to confirm that the values have been properly passed from the sending APEX screen:

我们可以在66页上查看page items FLIGHT_SCHED和FLIGHT_NBR是否被正确的赋值。

例子二:

create two pages (blank form) as page 10 and page 11.

In Page 10 create two text item as p10_xx, p_10_yy
In Page 11 create one text item as p11_zz.

The following two objectives need to be done.

1. If i enter 1 in p10_xx, the value 'one' should be displayed in p10_yy. if any other value other than 1 is entered in p10_xx then 'others' should get displayed in p10_yy.

2. When i run the page 11, p11_zz should display the value stored in p10_yy.

First thing in page 10 you select the property of p10_xx as text_field ( always submit when enter pressed) instead of mear text_field.

This will facilitate, any value type in this item (p10_xx) and pressing enter will fire submit.

Now you write a process on submit after computation and validation) (Once per session)
declare
avar varchar2(30);
begin 
if :p10_xx = 1 then
avar := 'one';
else
avar := 'others';
end if;
:p10_yy := avar;
end;

edit the branch process give the following values against the labels mentioned below:
Target is a ==> Page in this application
Page ==> 10
set these items ==> p11_zz
with these values ==> &p10_yy.

Now try to run page 10 you can find values in p10_yy. Now run page 11 you will find the values of p10_yy in this present page against p11_zz

参考自:

1.Oracle Application Express (APEX): Passing values between screens

http://www.dba-oracle.com/htmldb/t_passing_values_between_screens.htm

2.can any one help me pls how to pass parameter from one page to another page.

http://www.orafaq.com/forum/t/140239/0/



你可能感兴趣的:(apex)