Hello my Forum Pals!
In my application, I have the Repeated Object which has 4 rows displayed from the
database. However, the first row is often repeated and therefore, when it repeats
itself,
I want to make sure that it's skipped.
The way I wrote my code right now, it displays the first row in the first record and
doesn't
display any following first row. I have to mention this first row has its own table,
"Businesses", however, in that particular query, it's taken from another table
"textArticles" (just in case it helps).
Here's the code that I'm using. Does anybody have any suggestions? What should I
change?
//[[SPIDER_EVENT<this_onBeforeDisplayEvent>
public int this_onBeforeDisplayEvent(CSpDisplayEvent event)
{
CSpValue date = CSpider.getUserSessionObject("sesDate");
CSpSelect doViewResults = (CSpSelect) CSpider.getDataObject
("doViewResults");
doViewResults.clearDynamicCriteria ();
doViewResults.addDynamicCriterion ("textArticles_Date",
CSpCriteriaSQLObject.EQUAL_TO_STR_OPERATOR, date);
doViewResults.execute ();
return (PROCEED);
}
//]]SPIDER_EVENT<this_onBeforeDisplayEvent>
//[[SPIDER_EVENT<Repeated1_onBeforeRowDisplayEvent>
public int Repeated1_onBeforeRowDisplayEvent(CSpDataDrivenVisualEvent event)
{
CSpider.putUserSessionObject("sesRowIndex", (CSpValue) new
CSpInteger(event.getRowIndex()));
return (PROCEED);
}
//]]SPIDER_EVENT<Repeated1_onBeforeRowDisplayEvent>
//[[SPIDER_EVENT<cbBusinesses_onBeforeDisplayEvent>
public int cbBusinesses_onBeforeDisplayEvent(CSpDisplayEvent event)
{
if (((CSpInteger)
CSpider.getUserSessionObject("sesRowIndex")).intValue() == 0) {
return (PROCEED);
}
else {
return (SKIP);
}
}
//]]SPIDER_EVENT<cbBusinesses_onBeforeDisplayEvent>
Thanks a lot in advance,
Rimma
_________________________________________________________________________
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]