tag:blogger.com,1999:blog-869579236085438805.post1813001897119297958..comments2024-02-17T17:44:10.911+10:00Comments on Random Insights into Oracle: APEX Global AJAX variables - gotta love themMark Lancasterhttp://www.blogger.com/profile/06316329564169609358noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-869579236085438805.post-6033797476988824852011-01-30T20:12:39.119+10:002011-01-30T20:12:39.119+10:00Hi Andy
For this demo I'm loading a APEX list...Hi Andy<br /><br />For this demo I'm loading a APEX list into a collection. Any changes made by a user are applied to the collection using the WWV_FLOW_COLLECTION package.<br /><br />I'm using a collection so changes are limited to an individual users session, and aren't permanent.<br /><br />To apply the changes permanently back to the APEX list, you would use the WWV_FLOW_API package to do so. Just do a component export of a list to see the steps required.<br /><br />Of course, you could also create your own tables and manipulate as you wish.<br /><br />Regards<br /><br />MarkMark Lancasterhttps://www.blogger.com/profile/06316329564169609358noreply@blogger.comtag:blogger.com,1999:blog-869579236085438805.post-32044847506359010702011-01-28T20:41:16.055+10:002011-01-28T20:41:16.055+10:00Hi Mark,
Sorry if this a dumb question, but... on...Hi Mark,<br />Sorry if this a dumb question, but... once inside APEX, are you updating an existing list (As in a "Shared Component -> List"). Or are you using another mechanism within APEX?<br />Cheers,<br />Andy.Andy Seddonnoreply@blogger.comtag:blogger.com,1999:blog-869579236085438805.post-70011197983556488122009-03-21T22:02:00.000+10:002009-03-21T22:02:00.000+10:00Hi Louis-GuillaumeThe g_widget_num_return call you...Hi Louis-Guillaume<BR/><BR/>The g_widget_num_return call your referring to is from a call to refresh the interactive report.<BR/>It's a left over call from when I was debugging.<BR/><BR/>Carl indicated in his post in the replies that he was passing a value all the time, so g_widget_num_return was just convenient.<BR/>He also said to avoid using g_widget_name (did not elaborate), and that g_clob_01 may not survive in future releases.<BR/><BR/>Ultimately, the variables are simply PL/SQL package variables that we are free to use, safe in the knowledge that we aren't causing nasty side effects.<BR/><BR/>As far as the variables go, all I have to go on is the wwv_flow spec:<BR/><BR/> g_widget_name varchar2(255);<BR/> g_widget_mod varchar2(255);<BR/> g_widget_action varchar2(255);<BR/> g_widget_action_mod varchar2(255);<BR/> g_widget_num_return varchar2(255);<BR/><BR/> g_x01 varchar2(32767);<BR/> g_x02 varchar2(32767);<BR/> g_x03 varchar2(32767);<BR/> g_x04 varchar2(32767);<BR/> g_x05 varchar2(32767);<BR/> g_x06 varchar2(32767);<BR/> g_x07 varchar2(32767);<BR/> g_x08 varchar2(32767);<BR/> g_x09 varchar2(32767);<BR/> g_x10 varchar2(32767);<BR/> g_clob_01 clob;<BR/><BR/>My standards:<BR/> - g_x01 .. g_x10 are much bigger, so I save them for my data<BR/> - g_widget_name identifies the module (package) to call<BR/> - g_widget_action identifies the operation to perform<BR/> - other variables future use ???<BR/><BR/>I use a single application process for all my AJAX code which simply calls an ajax "gateway" package.<BR/><BR/>The "gateway" package delegates to an appropriate package based on the g_widget_name value.<BR/><BR/>Each package spec contains a widget procedure and looks like this:<BR/><BR/> CREATE OR REPLACE PACKAGE ext_tree_editor IS<BR/> procedure widget;<BR/> END ext_tree_editor;<BR/><BR/>The widget procedure then calls a private procedure, determined by the g_widget_action value. <BR/><BR/>i.e. application process -> gateway package -> widget package [g_widget_name] -> widget procedure [g_widget_action]Mark Lancasterhttps://www.blogger.com/profile/06316329564169609358noreply@blogger.comtag:blogger.com,1999:blog-869579236085438805.post-10967655410597650942009-03-21T13:28:00.000+10:002009-03-21T13:28:00.000+10:00The link in your article goes to page 2011 where a...The link in your article goes to page 2011 where as your Tree Editor is actually on page 2013. <BR/><BR/>Did you mean for this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-869579236085438805.post-26345605918726750062009-03-21T05:55:00.000+10:002009-03-21T05:55:00.000+10:00I found the article Carl wrote about those variabl...I found the article Carl wrote about those variables.<BR/><BR/>http://carlback.blogspot.com/2008_03_01_archive.htmlLouis-Guillaumehttps://www.blogger.com/profile/06491876959467764686noreply@blogger.comtag:blogger.com,1999:blog-869579236085438805.post-63034195675950196522009-03-21T01:16:00.000+10:002009-03-21T01:16:00.000+10:00Hi Mark,This is a good demo.Can you give us more i...Hi Mark,<BR/><BR/>This is a good demo.<BR/><BR/>Can you give us more information about the following variables:<BR/>g_widget_name<BR/>g_widget_mod<BR/>g_widget_action<BR/>g_widget_action_mod<BR/>g_widget_num_return<BR/><BR/>I want to use them the good way. What are your standards?<BR/><BR/>example: When I edit a tree element, I can use firebug to look at the HTTPRequest. I see g_widget_num_return=15 and the interactive report shows 15 rows. Why not use g_x10=15 to do the same? Give me some advices plz. :)<BR/><BR/>ThanksLouis-Guillaumehttps://www.blogger.com/profile/06491876959467764686noreply@blogger.com