re/ Newbie: Session variable problem
"WILLIAM GARNETT" <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <4544A076.000003.05652@BILL> |
Paul,
Off the cuff it would seem that setCurrentBatchIndex() expects an int as it
s parameter; i.e. is defined as:
void setCurrentBatchIndex( int newBatchIndex ){
....
}
if so:
dBatch and dBatch() return Integer; change both of those to int and it
should work. (Also change parameter in setDBatch to int.)
If this is not possible, change the other line as follows:
nextPage.donationDisplayGroup.setCurrentBatchIndex( sess.dBatch()
intValue() );
Hope this helps.
Cheers,
Bill
===================================================
Could someone please help me solve this session variable problem.
If I use this line of code everything works as desired.
"nextPage.donationDisplayGroup.setCurrentBatchIndex(3);"
When I try the same line replacing the "3" with "sess.dBatch()" it doesn't
work. Gives error "can't resolve symbol"
What is the correct way to right these two lines...?
Session sess = (Session)session();
nextPage.donationDisplayGroup.setCurrentBatchIndex(sess.dBatch());
A more complete code sample is shown below.
Thank You.
------- In Session.java ---------------
public class Session extends WOSession {
< bunch of code snipped out>
public Integer dBatch ;
public Integer dBatch() {return dBatch; }
public void setDBatch(Integer newDBatch) { dBatch = newDBatch; }
}
-----Code from a separate web component trying to read variable "dBatch"
from session----
public SearchDonations doList()
{
SearchDonations nextPage =
(SearchDonations)pageWithName("SearchDonations");
nextPage.donationDisplayGroup.qualifyDataSource();
/* this next line works ---
nextPage.donationDisplayGroup.setCurrentBatchIndex( 3 );
the correct batch of the displaygroup is shown on the next page
*/
Session sess = (Session)session();
// this line does not work --
// The code won't compile. Gives error can't resolve symbol
nextPage.donationDisplayGroup.setCurrentBatchIndex(sess.dBatch());
return nextPage;
Cheers,
Bill.