Permalink
Browse files

Merge branch 'support-singleclick-parameter' of https://github.com/jo…

…chenberger/tapx into jochenberger-support-singleclick-parameter

Conflicts:
	tapx-datefield/src/main/java/com/howardlewisship/tapx/datefield/components/DateField.java
  • Loading branch information...
hlship committed Apr 2, 2011
2 parents 88c9b0f + 17ee643 commit aa9983edb5495ba8f83d96c76d2ebd43f4a6274a
@@ -1,4 +1,4 @@
-// Copyright 2009, 2010 Howard M. Lewis Ship
+// Copyright 2009, 2010, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -69,6 +69,12 @@
@Import(stack = "tapx-datefield")
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}.
*/
@@ -269,8 +275,8 @@ public void beginRender(MarkupWriter writer)
writeTimeZone(writer);
- JSONObject spec = new JSONObject("clientId", clientId, "clientDateFormat",
- formatConverter.convertToClient(format)).put("time", time);
+ JSONObject spec = new JSONObject("clientId", clientId, "clientDateFormat", formatConverter
+ .convertToClient(format)).put("time", time).put("singleClick", singleClick);
javascriptSupport.addInitializerCall("tapxDateField", spec);
}
@@ -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
});
}

0 comments on commit aa9983e

Please sign in to comment.