Skip to content

Commit

Permalink
add singleClick parameter, controlling whether the pop-up closes when…
Browse files Browse the repository at this point in the history
… a date is selected
  • Loading branch information
jochenberger committed Dec 7, 2010
1 parent acf0fd8 commit 17ee643
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -57,6 +57,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}.
*/
Expand Down Expand Up @@ -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);
}
Expand Down
Expand Up @@ -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 17ee643

Please sign in to comment.