Return-Path: Delivered-To: apmail-incubator-click-dev-archive@minotaur.apache.org Received: (qmail 83381 invoked from network); 27 Apr 2009 08:19:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Apr 2009 08:19:54 -0000 Received: (qmail 53031 invoked by uid 500); 27 Apr 2009 08:19:53 -0000 Delivered-To: apmail-incubator-click-dev-archive@incubator.apache.org Received: (qmail 53006 invoked by uid 500); 27 Apr 2009 08:19:53 -0000 Mailing-List: contact click-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-dev@incubator.apache.org Received: (qmail 52998 invoked by uid 99); 27 Apr 2009 08:19:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2009 08:19:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2009 08:19:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D7242234C4AE for ; Mon, 27 Apr 2009 01:19:30 -0700 (PDT) Message-ID: <426177945.1240820370880.JavaMail.jira@brutus> Date: Mon, 27 Apr 2009 01:19:30 -0700 (PDT) From: "Bob Schellink (JIRA)" To: click-dev@incubator.apache.org Subject: [jira] Closed: (CLK-527) FormTable sort fields are not populated for render In-Reply-To: <569924452.1240558710387.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLK-527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bob Schellink closed CLK-527. ----------------------------- Resolution: Fixed Fix Version/s: 1.5.2 2.0.2 2.1.0 Thanks for the clarification Ben. Fixed in trunk and backported to 1.5.2 and 2.0.2 > FormTable sort fields are not populated for render > -------------------------------------------------- > > Key: CLK-527 > URL: https://issues.apache.org/jira/browse/CLK-527 > Project: Click > Issue Type: Bug > Components: core > Affects Versions: 1.5 > Reporter: Ben Warner > Fix For: 2.1.0, 2.0.2, 1.5.2 > > > On an instance of FormTable we have the capability to set the sorted column, sorted ascending, and page number values. These methods are inherited from the Table class but no overridden methods are provided in Form Table. > When the form table is rendered there are hidden form fields defined which are intended to store the values of these properties but the values of these hidden fields don't ever seem to be set. These hidden fields get rendered in the startTag() method of the internal form... > buffer.append(getForm().startTag()); > Because these fields are not populated, the submit function is not aware of any sorting that has been applied to the table and the values are often populated into the wrong underlying objects if the default sorting of the table is not the same as the explicit sorting of the table. > I've resolved this for my application by subclassing FormTable and overriding the 3 relevant methods as follows: > public void setSortedColumn(String columnName) { > Field field = (Field)getForm().getFields().get(COLUMN); > if(field != null){ > field.setValue(columnName); > } > setSorted(false); > super.setSortedColumn(columnName); > } > public void setSortedAscending(boolean ascending) { > Field field = (Field)getForm().getFields().get(ASCENDING); > if(field != null){ > field.setValue("" + ascending); > } > setSorted(false); > super.setSortedAscending(ascending); > } > public void setPageNumber(int pageNumber) { > Field field = (Field)getForm().getFields().get(PAGE); > if(field != null){ > field.setValue("" + pageNumber); > } > super.setPageNumber(pageNumber); > } > These overridden methods should be in FormTable to resolve this bug. I have been working with version 1.5 so it may already be resolved in a later version. > Note also that I am calling setSorted(false) in the first 2 methods. > BW. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.