5 Replies Latest reply: Feb 5, 2006 10:22 PM by 60437 RSS

    Source Used Item Attribute

    MonikaGarg
      Hi All,

      I am using HTML DB 2.0. I am a new user of HTMLDB. Please explain the difference between 2 Source Used Item Attribute
      1. Always, replacing an existing value in session state
      2. Only when current value in session state is null.

      If there is already a thread on this, please give me the link.

      Thanks in advance
      Monika
        • 1. Re: Source Used Item Attribute
          60437
          Monika - Always... means that every time the page is rendered the item displayed on the form will get its value from whatever Soure attribute the item uses (SQL query, database column, PL/SQL expression, etc.) and Only... means that every time the page is rendered the item displayed on the form gets its value from session state, i.e., its previously saved value, unless that value is null in which case the Source attribute determines the value displayed.

          Scott
          • 2. Re: Source Used Item Attribute
            VANJ
            Scott: You had once told me that regardless of how an item gets its source (either Always... or Only..), once it obtains its source value, it can be used by other page components further on during rendering.

            I have a textarea item P1_CSS set to Always... and I put the CSS fragment in the Source box.

            A Chart region further on in the page uses &P1_CSS. as its Custom CSS.

            This doesn't work. The chart uses the default CSS and not my P1_CSS fragment.

            Why is this?

            Thanks
            • 3. Re: Source Used Item Attribute
              60437
              Hmm, as of 2.0, bind variable references to "uncommitted" session state will succeed in requests spawned by the request that saves a value into uncommitted session state. So if page 1 (first http request) sets a value using an item source type, this value exists only in the package variable arrays. However, a chart or CSV request (second http request) launched by the same page (and served by a new database session) will be able to "see" that item's value by referencing session state using bind variable notation (from PL/SQL or SQL). Unfortunately, it is not possible to reference the same item in session state from that new database session using &ITEM. notation. You need either to have submitted the page first or to have used a process/computation or a session-state committing source method to set the value in committed session state.

              Scott
              • 4. Re: Source Used Item Attribute
                VANJ
                as of 2.0, bind variable references to
                So are you saying that this behaviour is different in v1.6?
                However, a chart or CSV request (second http request)
                launched by the same page (and served by a new
                database session) will be able to "see" that item's
                You mean, "will NOT be able to ..."
                a session-state committing source method to set the value in committed session
                What is an example of a "session-state committing source method"? I thought the Source method only operated upon the in-memory value during page rendering, it never updated session state.

                Thanks
                • 5. Re: Source Used Item Attribute
                  60437
                  So are you saying that this behaviour is different in v1.6?
                  Yes. Otherwise the PPR stuff wouldn't work when those requests referenced uncommitted session state.
                  You mean, "will NOT be able to ..."
                  No, it will be able to see the value of the item (in uncommitted session state). That's the change from 1.6.
                  What is an example of a "session-state committing source method"?
                  Code that not only sets the source of the item for display but as a side-effect cause update_cache_with_write to occur for that item or for any other item(s). For example a PL/SQL Function source type that returns the source value and also does :P1_ITEM := 'value'; .

                  Scott

                  Message was edited by:
                  sspadafo