Grid with paginaition ->data connector -> render sql

Hi,

is there a way to know
what record# are requested before rendering SQL

application has a Grid with pagination which displays records by render sql

require:
I want to know what is the start# and the # of records to display
before rendersql is called
upon clicking fetch next page on the grid

So that I can run some additional queries with the above acquired parameters and then call the renderSQL.

Thank you,

You can override doGet method of connector, to get access to the request object.
After that you can check posStart and count parameters of incoming request

Hi,

I am sorry can you please give more details as to what do you mean by
override doGet method of connector, to get access to the request object.
Pointing to a cod would help.

posStart and count parameters of incoming request does this parameter only available when smart rendering is enabled? currently we use only dynamic rendering.

Your help will be highly appreciated.

Thank you,
–Pradeep

posStart and count parameters of incoming request does this parameter only available when smart rendering is enabled

Yep, only in that case.
Also, they may not be set for first request ( in such case postStart = 0 may be used )

As for incoming parameters

[code]public class SimpleDataSource extends ThreadSafeConnectorServlet {

@Override
protected void configure(HttpServletRequest req, HttpServletResponse res) {
	Connection conn = ( new DataBaseConnection()).getConnection();

//parameter from request
String some = req.getParameter(“some”);

	CommonConnector data = new GridConnector(conn);
	data.servlet(req, res);
	data.render_table("touch_users", "id", "name,age,group_name,city,phone,sex,driver_license");
}

}[/code]