Is there a problem with next functionality ?

Hi,

I am having a search results page with first/prev/next/last

functionality.Say the search results in 100 rows and the max.no of display

tiles is 25. In my search results page, 1-25, 26-50 are coming properly. On

the search results page (showing 26-50), if we hit next,we are again

getting 1-25.(we are expecting 51-75). Is there a problem in the frame work

or is it a coding problem ? The model I am having is a custom model ( which

extends from DefaultModel, not from QueryModelBase).

Thanks in Advance,

syam.

[609 byte] By [Guest] at [2007-11-25 9:31:38]
# 1

Syam--

> I am having a search results page with first/prev/next/last

> functionality.Say the search results in 100 rows and the max.no of display

> tiles is 25. In my search results page, 1-25, 26-50 are coming properly.

On

> the search results page (showing 26-50), if we hit next,we are again

> getting 1-25.(we are expecting 51-75). Is there a problem in the frame

work

> or is it a coding problem ? The model I am having is a custom model (

which

> extends from DefaultModel, not from QueryModelBase).

The key is this line from RequestHandlingTiledViewBase (line 1255):

int offset=

((DatasetModel)models).getLocationOffset();

setWebActionModelOffset(offset);

These are the lines that get the location offset from the model and save it

to the page session. But, note this in DefaultModel (line 221):

public int getLocationOffset()

{

return 0;

}

This is the normal behavior for the default model--there is generally never

an offset for this model. However, you have extended the model to use an

offset, so you must override this method to return the proper information.

Once you do this, your web actions should work as expected.

Todd

Guest at 2007-7-1 18:24:35 > top of Java-index,Development Tools,Java Tools...