This documentation is for an old version of fiftyfive-wicket (2.0.9).


fiftyfive.wicket.js.datetime
Class JQueryDatePicker

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by fiftyfive.wicket.js.AbstractJavaScriptContribution
          extended by fiftyfive.wicket.js.DomReadyTemplate
              extended by fiftyfive.wicket.js.datetime.JQueryDatePicker
All Implemented Interfaces:
Serializable, IBehavior, IComponentConfigurationBehavior, IClusterable, IHeaderContributor

public class JQueryDatePicker
extends DomReadyTemplate

A simple jQuery UI-based replacement for Wicket’s YUI-based DatePicker. This implementation has the following behavior:

Here’s how you might use it in practice:

 add(DateTextField.forDatePattern("date", "MM/dd/yyyy")
     .setRequired(true)
     .add(new JQueryDatePicker())
 );

In keeping with the fiftyfive-wicket-js design philosophy, this Java class is extremely lightweight, allowing programmatic access only to change the button image that is used by the picker. This should suffice for most simple date picker use cases. If you want a different set of date picker behavior, write a subclass and provide your own accompaning JavaScript file to peform the desired initialization.

Since:
2.0
See Also:
Serialized Form

Constructor Summary
JQueryDatePicker()
           
 
Method Summary
 ResourceReference getButtonImage()
           
 CharSequence getButtonImageUrl()
          Returns the URL for the button image, for use inside the JavaScript template as ${behavior.buttonImageUrl}.
 JQueryDatePicker setButtonImage(ResourceReference buttonImage)
          Sets the button image (a calendar icon, for example) that will be displayed and used to show and hide the date picker when clicked.
static void setDefaultButtonImage(ResourceReference defaultImage)
          Sets the date picker button image that will be used by default for all date pickers.
 
Methods inherited from class fiftyfive.wicket.js.DomReadyTemplate
bind, detach, getCompressor, renderHead
 
Methods inherited from class fiftyfive.wicket.js.AbstractJavaScriptContribution
renderDependencies, renderDomReady
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, cleanup, detachModel, exception, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onException, onRendered, rendered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JQueryDatePicker

public JQueryDatePicker()
Method Detail

setDefaultButtonImage

public static void setDefaultButtonImage(ResourceReference defaultImage)
Sets the date picker button image that will be used by default for all date pickers. This static method is convenient because most applications will use the same icon throughout the entire application. To change the image on an individual picker, call setButtonImage().


setButtonImage

public JQueryDatePicker setButtonImage(ResourceReference buttonImage)
Sets the button image (a calendar icon, for example) that will be displayed and used to show and hide the date picker when clicked. By default this is the famfamfam Silk famfamfam Silk calendar icon, or whatever was provided to setDefaultButtonImage().

Returns:
this to allow chaining

getButtonImage

public ResourceReference getButtonImage()

getButtonImageUrl

public CharSequence getButtonImageUrl()
Returns the URL for the button image, for use inside the JavaScript template as ${behavior.buttonImageUrl}.



Copyright © 2011 55 Minutes. All Rights Reserved.