Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support singleclick parameter #18

Merged
merged 1 commit into from

2 participants

@jochenberger
Collaborator

The jscalendar script supports a parameter named singleClick that controls whether the popup window closes when a date is selected. I added this parameter to the datefield component.

@hlship hlship merged commit 17ee643 into hlship:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2010
  1. @jochenberger
This page is out of date. Refresh to see the latest.
View
8 tapx-datefield/src/main/java/com/howardlewisship/tapx/datefield/components/DateField.java
@@ -58,6 +58,12 @@
public class DateField extends AbstractField
{
/**
+ * If true, the pop-up closes when a date is selected
+ */
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private boolean singleClick = true;
+
+ /**
* The value parameter of a DateField must be a {@link java.util.Date}.
*/
@Parameter(required = true, principal = true, autoconnect = true)
@@ -242,7 +248,7 @@ public void beginRender(MarkupWriter writer)
writer.end(); // img
JSONObject spec = new JSONObject("clientId", clientId, "clientDateFormat", formatConverter
- .convertToClient(format)).put("time", time);
+ .convertToClient(format)).put("time", time).put("singleClick", singleClick);
javascriptSupport.addInitializerCall("tapxDateField", spec);
}
View
3  tapx-datefield/src/main/resources/com/howardlewisship/tapx/datefield/tapx-datefield.js
@@ -7,6 +7,7 @@ Tapestry.Initializer.tapxDateField = function(spec)
showsTime : spec.time,
ifFormat : spec.clientDateFormat,
timeFormat : spec.time && spec.clientDateFormat.match("%p") != null ? "12" : "24",
- cache : true
+ cache : true,
+ singleClick : spec.singleClick
});
}
Something went wrong with that request. Please try again.