Monday, September 29, 2008

Click 1.5 Release Candidate 2 is available!

RC1 introduced a severe bug which hampered Click from deploying properly. To resolve this issue we are making RC2 immediately available.

We apologize for the inconvenience.

Please try out RC2 and provide feedback via our mailing lists or issue tracker.

Issues resolved for RC2:
  • Emergency Fix: Click throws FileNotFoundException when deploying click-extras.jar [448].
  • Added new method Page.removeControl which enables Click to automatically remove a Control from its parent when adding it to another Container. This issue was raised and fixed by Ricardo Lecheta [449].
  • Added utility methods ClickUtils.encodeURL and ClickUtils.decodeURL for encoding and decoding URL's using the "UTF-8" encoding scheme.
The Click team.

Sunday, September 28, 2008

Click 1.5 Release Candidate 1 is now available!

This should be the last release before 1.5 final. We have received good feedback and a large number of issues have been resolved. Thanks to everybody for their contributions in making this release possible.

We urge everybody to try out RC1 and provide feedback via our mailing lists and issue tracker.

Apache Incubation Status:

As you might know already Click was voted to undergo incubation at Apache Incubator. One of our tasks is to migrate current infrastructure to the new hosting. New mailing lists have been setup for users and developers. Information on subscribing to the new mailing lists can be found here. If you would like to unsubscribe from the existing SourceForge lists follow the instructions here.

Highlights for this release:
  • Refactored Paginator into a more generic interface called Renderable which is independent of any specific Control
  • Added Table Row attribute support through new method addRowAttributes.
  • Field error messages can now be specified per instance. See the JavaDoc for more details.
Issues resolved for RC1:
  • Refactored Paginator into a more generic interface called Renderable which is independent of any specific Control [434].
  • Add new LinkDecorator methods renderActionLink and renderActionButton. This allows more fine grained control over the rendered links, for example manipulating request parameters. [446].
  • Add Table Row attribute support through new method addRowAttributes. This issue was raised by Hans Poo [431].
  • Field error messages can now be specified per instance. See the JavaDoc for more details. This issue was raised and fixed by Ricardo Lecheta [433].
  • Added new utility methods copyContainerToObject and copyObjectToContainer to selectively exclude or include form fields when populating domain objects. This issue was raised by Khalef Bessaih [440].
  • Encapsulate conversion logic of template extensions inside Page.setRedirect(java.lang.String) which allows one to override or overload the default behavior. This issue was raised by David Ballard [429].
  • Improved Table so that subclasses can specify a different controlLink implementation by overriding getControlLink(). This issue was raised and fixed by Ricardo Lecheta [442].
  • Improved ClickUtils.toLabel to return empty String ("") if argument is null [441].
  • Improved DateField to return a cached Date representation on subsequent retrievals. This issue was raised by Tore Halset [316].
  • Fixed RegexField validation to ignore empty values. This issue was raised by Muzaffer Ozakca [436].
  • Fixed TabbedPanel to trigger the registered tab listener. This issue was raised by Marcelo Grassi Franco Melgaço. [432].
  • Improved redirect and forward to JSP templates. [435].
  • Fixed HtmlFieldSet to properly close the fieldset end tag. This issue was raised by Gilberto C. Andrade [427].
  • Fixed AbstractContainerField not to bind its request parameter. This issue was raised by Gilberto C. Andrade [428].
  • Fixed Column which exposed its internal Comparator as public API through Column.setComparator(Comparator), instead of java.util.Comparator. [430].
  • Fixed LinkDecorator not to add Table parameters to PageLink, as it is redundant. This issue was raised by Joel Schmidt [270].
Enjoy Click.

The Click team.

Sunday, August 17, 2008

Click 1.5 M3 is now available!

Milestone 3 is the final milestone in the 1.5 series and provides much improved backward compatibility.

Highlights for this release:
  • New features include a pluggable Paginator for Table and two implementations: DefaultPaginator and InlinePaginator.
  • Major refactoring to improve backward compatibility and upgrade path. This includes removing BasicForm and adding new Controls HtmlForm and HtmlFieldSet.
  • Added support for multiple page package definitions in click.xml configuration
New documentation:
New examples:
Issues resolved:
  • Added readonly and disabled support to FieldSet. If enabled Fields contained in FieldSet will be disabled or made readonly. [423].
  • Added Table footer rendering support, so that column totals can be rendered in a table [425].
  • Improved Table rendering performance in the order of 25-45%.
  • Improved rendering performance by caching the ClickUtils resource version indicator [412].
  • Improved Page and PageImports to allow a Pages to optimize their HTML imports. Please see Click Examples for a demonstration [363].
  • Fixed issue where Select validation can throw ClassCastException when option list contains an OptionGroup. This issue was identifier by Christophe Foiret [374].
  • Fixed issue where Container can be added to itself. This issue was identifier by Harry Wissiak [414].
  • Fixed Page serialization issues with non serializable Format and PageImport objects. This issue was identifier by Alexei Sokolov [416].
  • Fixed issue where CayenneForm clearValues() was hidden data object classname. This issue was identifier by Wisking Ju Yu Wu [417].
  • Fixed issue where TabbedPanel was invoking the activePanel's onInit() method twice. This issue was identifier by Wisking Ju Yu Wu [420].
Enjoy Click.

The Click team.

Sunday, July 20, 2008

Click 1.5 M2 now available!

Click 1.5 Milestone 2 is available for download. This is the second installment in the 1.5 development branch and provides important new features and bug fixes.

Highlights for this release:
  • ActionListener - new interface provides compile time safety and support for code refactoring tools.
  • ControlRegistry - enables two phase listener dispatch, which allows Controls to bind request parameters before listeners are fired.
  • Introduced a new resource deployment strategy for Jars containing Page and Control resources.
New documentation:
Issues resolved:
  • Added a new PageButton control [392].
  • Add new method CheckboxTree.setSelectChildNodes that enables selecting child nodes when parent is selected. This feature only works if the Tree's Javascript support is enabled. [209].
  • Added Romanian property files. This issue was raised and fixed by Marius Petrus [361].
  • Add width support to TabbedPanel control [376].
  • Add ClickUtils autoPostRedirect() method to support SAML integration [398].
  • Renamed Container.add(int, Control) to Container.insert(Control, int) [381].
  • Update Form to use control message bundles for label required prefix/suffix [383].
  • Update HtmlStringBuffer to support method chaining. This issue was raised by Demetrios Kyriakis [396].
  • Updated Menu to only be cached in production or profile modes. [408].
  • Moved AbstractContainerField control to Click Extras. [410].
  • Fixed TabbedPanel bug whereby inactive panel HTML imports are included in page [366].
  • Fixed bug when manually invalidating HttpSession [371].
  • Fixed PropertySelect add ordering to query bug [372].
  • Fixed message properties to resolve all parent messages [373].
  • Fixed Labels not rendering in a FieldSet bug [377].
  • Fixed Form removeField throws IllegalArgumentException bug [378].
  • Fixed bug where Format is not available in template of stateful pages. [409].
Enjoy Click.

The Click team.

Monday, May 19, 2008

Click 1.5 Milestone 1 released!

Click 1.5 Milestone 1 has been released yesterday. This is the first installment in the 1.5 development branch and provides a host of new features. Important links:

Highlights for 1.5-M1 include:
  • Container - new interface for building arbitrary complex, hierarchical Controls.
  • Services - Click core has been refactored into pluggable services.
  • Added Freemarker support as an alternative templating engine to Velocity. See FreemarkerTemplateService for configuration details.
  • Mock Test Support - introduces an easy to use package to write Unit and Functional Tests.
  • A new Powered by Click section was added. If you would like to add your own site to this list, please send us a mail to one of our Mailing Lists, or directly to "sabob1 at gmail.com".
  • More examples and documentation.
New Examples:
New documentation:
Issues resolved:
  • Improved performance by rendering from a single non-blocking buffer.
  • Added a Country Select control based on the JDK's own built in Country/Locale support.
  • Added a Virtual Keyboard control using GreyWyvern JavaScript library.
  • Added support for setting Form action URL attribute. This issue was raised by Erdem Gunay [319].
  • Added support for Page HTML imports with a new getHtmlImports() method. This enables Pages to programatically define HTML imports which will be included in a border template using the PageImports object. This issue was raised by David Frizelle [329].
  • Add Page setTemplate(String) method to enable dynamic changing of a page border template. This issue was raised by Huy Do [353].
  • Updated Page.setPath to handle JSP resources. This issue was raised and fixed by Huy Do. [141].
  • Added support for Hibernate AnnocationConfiguration. This issue was fixed by Jean-Francois. [355].
  • Improved FileUpload support. This issue was raised by Ricardo Lecheta [326].
  • Improve File Upload support with new FileUploadService class. [326].
  • Fixed Cayenne PropertySelect which is not reset to original value. This is was raised by Tore Halset [317].
  • Fixed Cayenne 3.0M3 DataObjectUtils issue in CayenneForm when using JDK 1.5. Added CayenneUtils helper class [342].
Enjoy.

The Click team.

Saturday, May 3, 2008

Click 1.4.2 maintenance release is available!

Click 1.4.2 is a minor maintenance release.

This release fixes a problem when using SpringClickServlet and excluded urls. We have also fixed a slight performance degradation since the 1.4 release.

Changes include:
  • Fix a slight performance degradation over the 1.4 release [349].
  • Fixed ExcludePage - should be a public inner class [346].
  • Fixed Maven artifact packaging [348].
  • Fixed PageLink to work with JSP pages [352].
  • Fix DateField and ChartFields to include control.js [354].
  • Fix DateField which could produce duplicate stylesheet head includes [356].
Enjoy.

The Click team.

Tuesday, April 8, 2008

Click supports functional and unit testing!

One of the first features completed for the upcoming 1.5 release, was to revamp the mock package and add functional and unit testing support. There is no need to extend any classes or override methods. Testing works out of the box.

For testing purposes there are two classes of interest: MockContainer and MockContext.
(Since 1.5 has not yet publicly available I will just refer to the actual source code)

Which class to use depends on what you want to test.

If you want to test your pages (functional tests) use the MockContainer which simulates a servlet container such as Tomcat or Jetty. With the container one will be enable to mock page requests, form submissions, file uploads, navigation etc.

In order to use MockContainer you need to specify a web directory where the container can find resources such as javascript, stylesheets and images. The easiest way to achieve this is to point the container to your project's web directory.

Example usage:

public class IntegrationTest extends TestCase {
    public void testFirstPage() {
        // Specify the project web directory for example: 'c:/dev/web'
        MockContainer container = new MockContainer("c:/dev/web");

        // Bootstrap the container
        container.start();

        // Set a request parameter
        container.setParameter("myparam", "Some parameter");

        // Simulate a user requesting the page, FirstPage. FirstPage will forward to SecondPage.
        FirstPage page = (FirstPage) container.testPage(FirstPage.class);

        // Assert that FirstPage does indeed forward to SecondPage
        Assert.assertTrue(container.getForwardPageClass(), SecondPage.class);

        container.stop();
    }
}
MockContext on the other hand is useful for testing custom controls (components).

Note that it is not necessary to specify a web directory when using MockContext.

Example usage:
public class ValidationFieldTest extends TestCase {

    public void testValidationField() {

        // Initialize the context.
        MockContext context = MockContext.initContext();

        int maxLength = 10;
        String fieldName = "name";
        ValidationField field = new ValidationField(fieldName, maxLength);

        // Retrieve the request and set field request parameter.
        MockRequest request = context.getMockRequest();
        request.setParameter(fieldName, "value");

        // onProcess binds the request attribute and field value
        assertTrue(textField.onProcess());

        // Assert that the field is still valid.
        assertTrue(textField.isValid());
    }
}
That is all there is to it.

The API is still evolving and feedback is appreciated. Our mailing lists are available here: