>>>
CSpPage nextPage = CSpider.getPage("command = nextPage.load(false);");
((CSpRepeated)nextPage.getCommonRepeated("Repeated1")).setCurrFirstRow(2
0);     
command = nextPage.load(false);
Unfortunately that currFirstRow is reset by ND.
<<<

I think there are a couple of ways you can handle this. One way is to
use an instance variable on 
PgCityStateList and set it before calling nextPage.load, and make that
page look at this instance variable to decide what to do.
However, that leaves the problem of remembering to reset the instance
variable.

I would feel much safer doing something like:
=======================================
CSpider.putWebVar("LoadFromWhereWasLeft", new CSpString("true"));
command = nextPage.load(false);
=======================================

And then inside PgCityStateList - Repeated1_onBeforeDisplayEvent():
============================================================
try {
        String val =
CSpider.getWebVar("LoadFromWhereWasLeft").stringValue();
        If (val.equals("true")) {
                // get the row number from USO and do setCurrFirstRow();
        }
}
catch (Exception ex) {
        // Relax
}
============================================================

If you are coming to this page from anywhere else the getWebVar should
fail and so the page will be its natural self.

Regards,

Aby


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 01, 1999 11:41 AM
To: [EMAIL PROTECTED]
Subject: [ND] can I setCurrFirstRow(20) for a repeat object and then do
a load(false)

First of all I would like to thank Aby Mathew for pointing out to me
using setCurrFirstRow(20) in Repeated1_onBeforeDisplayEvent()works.
It did as Aby suggested.

I can do that.

I must save the CurrFirstRowvalue in a session object.

The complication occurs in where to clear the session object.
I must clear it from every page that go to that page before i load that
page.
I also have to clear it in Repeated1_onBeforeDisplayEvent() if it was
set and use it.

It is very simple if I can setCurrFirstRow(session object value)only
from pages that i want to return to the previous value.


example:-
CSpPage nextPage = CSpider.getPage("PgCityStateList");
((CSpRepeated)nextPage.getCommonRepeated("Repeated1")).setCurrFirstRow(2
0);     

command = nextPage.load(false);

Unfortunately that currFirstRow is reset by ND.

I look at the value in Repeated1_onBeforeDisplayEvent() and it is reset
to 0.

Anyone have any suggestions?

Also what is the consequence of load(false).
If there are other display fields in the page which I did not clear,
would it sometimes display garbage?
Do I have to set all display values for it to work?

I would like to come up with the most efficient way to do this.
I will post my resulting code when I completed this task.
I am sure a lot of application can use this feature:-
You have a list which is display using a repeat object.
You navagate and find your item in say the 3rd page.
You then click a button or href from one row to see more details for
that item.
When you finish looking / doing something for that item you want to go
back to the original page (third page of your repeated object)
_________________________________________________________________________

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