see below

At 11:02 AM 5/21/99 -0800, [EMAIL PROTECTED] wrote:
>Hi,
>
>If some one could clarify the following that will be great-
>
>My Case:
>I have a DO that is not bound to the page, I am calling it on 
>the onBeforeDisplay event of the page and adding dynamic 
>criterion to it to personalize the contents of the page 
>(actually a listbox on the page) for the user. Now I want to use
>the same DO in onWebEvent of a button the page, regarding that I 
>have following questions-
>1. Why do I have to call execute() method of the DO before 
>calling its getValue()?

execute() causes the SQL 'select' statement to be sent to the dbms and
results to be retrieved back.  When the DO is bound to the page, the page
calls execute() automatically.  When the DO is not bound, you have to do it
yourself.

>2. Can I be sure that the DO's dynamic criteria is still the same
>assuming multiple user sessions are active and provided I did 
>not change the criteria any where else in the code? My understanding is
that- instances DOs are not shared between sessions.

I must admit I took a long time to get this straight (pre-emptive statement).

Dynamic criteria in a DO are like member variables in a page object.  They
hold for the life of a web event, i.e., from a page load or beginning of
button/href method, until a page is sent back to the browser (including the
situation where you set criteria on a DO in a button event, then load
another page and execute the DO in that page's onBeforeLoad or
onBeforeDisplay event).  And, at the outset of a web event, they must be
assumed to reflect work done in a previous web event using the same object.

At the beginning of a web event, the DO might have criteria set by another
page session.  So before you add any dynamic criteria for the current page
session, you must execute clearDynamicCriteria on the DO.  Then you can add
your current criteria.

Also, in case it was not clear above, in one web event, if you are in a
button event of PageA, and you call CSpider.getDataObject("DO"), 
and then you load PageB, and in its onBeforeLoadEvent, you call the same
CSpider.getDataObject("DO"), you will get the same object.  

-- Curt Springer, Team ND


>
>Thanks in advance to all the noble souls who are gonna reply...
>
>Vishal
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]
> 
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to