Hey Matt,

I agree with you that making the "middle tier" aware of displayag is a bit kludgy but I don't really see a way around it.

When I first tried to use the partialList feature, I thought that if I gave displayag an Iterable object, then it would only iterate "pageSize" many times through the iterator until the next page was requested.  No such luck though, it just iterated through the whole collection, but only displayed "pageSize" elements.

I'm not entirely sure of the specifics, but I believe the necessity for using the table "uid" attribtue arises from the fact that there can be more than one table on a page.

Anyways, I don't have a good answer, I hope someone else can shed some light!

Kevin

On 3/17/06, Matthew Payne <[EMAIL PROTECTED]> wrote:
On Thursday 16 March 2006 11:05 pm, Kevin Conaway wrote:

Thanks Kevin,

The patch works great and things are up and running.

I do however, wish we didn't have to have backend code depend on displaytag.
Using webwork, we typically don't have actions work with the HttpRequest
object directly, let alone the hoops you have to jump through to get
parameters out of the display tag.
I don't think an action should need to know the id of an attribute in the
view, let alone need to use display tag's Parameter Encoder and such.  Why
not tell display tag the name of request key to stuff this value in, rather
than make backend coded dependent on your view technology? e.g .
currentPageKey="currentPage"

vs these hoops we have to jump through  -->
(snippet from webwork interceptor trying to mask this logic from actions)

protected void before(ActionInvocation invocation) throws Exception {

        final Map params = ActionContext.getContext().getParameters();
        ActionConfig config = invocation.getProxy().getConfig();
        String tableId = (String)config.getParams().get(tableKey);
        //String tableId = (String) params.get(tableKey);

        if (tableId!= null) {
            log.debug("looking for values in table id:" + tableId);

            String pageKey = new
ParamEncoder(tableId).encodeParameterName(PAGE_PARAMETER); // find out what
the key in the request would be based on supplied table id
            String[] pagevalue =  (String[]) params.get(pageKey); // get the
value using the key

            if (pagevalue !=null) {
                Integer currentPage = Integer.parseInt(pagevalue[0]);
                OgnlValueStack stack =
ActionContext.getContext().getValueStack();
                log.debug("setting current page to:" + currentPage);
                stack.setValue("currentPage", currentPage);
            } else {
                LOG.debug("page size not found in parameters");
            }

            String orderKey = new
ParamEncoder(tableId).encodeParameterName(ORDER_PARAMETER); // find out what
the key in the request would be based on supplied table id
            String[] orderValue =  (String[]) params.get(orderKey); // get the
value using the key
            //value  Descending is 2, Ascending is 1.

            if (orderValue != null) {
                //we know asc or desc
            }

            //String sortKey = new
ParamEncoder(tableId).encodeParameterName(SORT_PARAMETER); // find out what
the key in the request would be based on supplied table id
            //String[] sortValue =  (String[]) params.get(orderKey); // get
the value using the key
            // sort value should be the id of the column that has the current
sort



        }


Matt



> Matthew,
>
> I have submitted a patch for DISPL-304:
> http://jira.codehaus.org/browse/DISPL-304
>
> Kevin


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to