Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between $v(pNd) and apex.item(pNd).getValue()

OraDev16Jul 30 2018 — edited Jul 30 2018

Hi All,

          To get the value of a page item using JS/JQ; I've the following two options. Both are giving results; but I think there is a subtle difference between them. 

          (1) getValue()

               apex.item("P1_ITEM").getValue() : Returns the current value of an Application Express item on a page, taking into account the current item type. This does not return the item's current value from session state (although that could be the same), rather it will return the value as it is on the current page.

               My Inference : It'll return the value from DOM (Browser Memory).

          (2) $v( pNd )

               $v("P1_ITEM") : which returns an item's value, but in the format it will be posted.

               My Inference : It'll return the value from DOM (Browser Memory) if not posted/submitted; otherwise it'll return the value from Session State.

Question

(1) Are they same or there's a difference.

(2) I tried to come up with an example showing the difference between the two approaches; but couldn't. Can anyone help.

Thanx.

This post has been answered by peter_raganitsch on Jul 30 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2018
Added on Jul 30 2018
4 comments
674 views