BIGtheme.net http://bigtheme.net/ecommerce/opencart OpenCart Templates
Home / Oracle / Apex / Oracle Apex API “$s()”

Oracle Apex API “$s()”

The Apex JavaScript API has some very convenient functions to access the values of page items.

For example, if you wante to access the contents of a text field with JavaScript, would would need to reference it something like this:

If the item you want to reference is a display only item, then the syntax changes:

If you need to set the values of these items, the you need to use the varying syntax as well:

or

Dealing with these various syntax constructs can be confusing. Fortunately the Apex JavaScript API makes this process much easier. To get page item values simply use $v(“<item_name>”):

To set the item values use:

See an example on my demo page.

If the item you want to reference is a display only item, then the syntax changes:

If you need to set the values of these items, the you need to use the varying syntax as well:

or

Dealing with these various syntax constructs can be confusing. Fortunately the Apex JavaScript API makes this process much easier. To get page item values simply use $v(“<item_name>”):

To set the item values use:

See an example on my demo page.

The $v2() is handy if you need to access multiple items in an array. For example multiple selections from check boxes or from a shuttle control can be fetched as an array and handled that way in JavaScript:

An example of this functionality can be seen on my demo page, where I also compare $v() and $v2() when used in an array.

Original article:  http://ruepprich.wordpress.com/2013/01/11/getting-and-setting-apex-page-item-values-using-v-s-v2/

Resource: Go

About Amr

Check Also

Oracle APEX | How to add a new row into tabular form by using Hot-Key [JS]

Dear, Now i share sample to using Hot-Keys [JS] to add a new row into ...

Oracle APEX | How to Create Hot-Keys by JavaScript ?

Dear, Now we doing Hot-Keys by JavaScript, Its so sample 🙂 [crayon-59c527c846fcf926079549/] Now Watching & ...