4 Replies Latest reply on Mar 18, 2010 9:49 PM by 728781

    htmldb_Get() Documentation vs Real Life

      Hello all,

      1) Has anyone taken over an official htmldb_Get() documentation project since Carl's passing? More importantly, is there any official, up-to-date documentation?

      2) I have noticed at least a couple of disparities from [the documentation|http://apex.oracle.com/pls/otn/f?p=11620:63] to the [Using AJAX in your Application|http://www.oracle.com/technology/obe/hol08/apexweb20/pdf/ajax_otn.pdf] tutorial.

      a. Document says:
      flow : (string) the HTML DB flow id for the xmlhttp post
               1. Almost always the best option is to put $x('pFlowId').value as this parameters value [this will be the default in next version].
      Tutorial says: $v('pFlowID'):
      var get = new htmldb_Get(null,$v('pFlowId'),
      b. Document says:
      .add(name,val) the add method is how you set item variables in the session
          * name : (string) is the the name of the item you want to set as a string
          * val : (string) is the value to set the item too
               1. you can set the value of any HTML DB item, items on the current page, application level items, items on other pages.
               2. you can set multiple items by applying multiple .add() calls to the AJAX object.
               3. if the value you need to add is transient look into using application level items such as TEMPORARY_ITEM as this will make your code more generic
      Tutorial says: .addParam
      Now, the tutorial is working for me so I'm inclined to suspect the documentation might be a bit skewed.

      So, back to my question. Is there any official, up-to-date documentation?


        • 1. Re: htmldb_Get() Documentation vs Real Life
          This has always kind of been a gripe of mine. As for the 2nd question, add requires that you have an application item and you pass that in (it puts your value to that item). addparam was a shortcut built-in a little later that puts your value to the x01 arrays - no need for an application item, so it is preferred.

          You can reference it like wwv_flow.g_x01...10.

          1 person found this helpful
          • 2. Re: htmldb_Get() Documentation vs Real Life
            Thanks Sc0tt. That explains some of what's going on.

            I am managing to stumble my way through understanding AJAX. Now I have an issue with refreshing the page without submitting it, but that's another subject. I'm finding good info on that already so, maybe I won't need to post anything on that.

            • 3. Re: htmldb_Get() Documentation vs Real Life
              Arie Geller
              Hello Gregory,

              The two references you mentioned were written for two different versions of APEX. Carl’s version (in page 63 of his demo application) is the more earlier version, and it doesn’t include some new features that were introduced in 3.1 (which, unfortunately, he has only referenced on his blog). In any case, there is no conflict between these versions, only the use of new JavaScript functions and new features.

              >> … $x('pFlowId').value … $v('pFlowId')

              These two functions yield the same result. $v() was introduced in 3.1 as a shorter syntax to $x(‘pId’).value .

              >> get.add() … get.addParam

              The first methods – add() – set session state. As such, it needs an APEX item (page or application level) and it has a persistent nature. Even if we had the need to use a temp variable, we still needed to define a “real” APEX item. To save us the trouble of dealing with transient variables, a group of 10 packaged items – g_x01 to g_x10 – were defined. These variables are not saved in session state, and we can set them by using the addParam() method. As they are packaged variables, they only last for the duration of your current AJAX request. As was mentioned by Scott, in your on-demand PL/SQL process, you can reference them by apex_application.g_x01 – apex_application.g_x10 (apex_application is a synonym to the wwv_flow package).


              ♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

              ♦ Forthcoming book about APEX: Oracle Application Express 3.2 – The Essentials and More
              1 person found this helpful
              • 4. Re: htmldb_Get() Documentation vs Real Life
                Thanks Arie. It's always good to hear someone else version as it will likely spark another thought or call to mind something one has overlooked. For example, that bit about
                 add() - set session state
                makes me wonder if I can apply that to something else I'm having trouble with.

                I'll have to ponder that a bit.