Author: musachy
Date: Tue Mar 10 19:07:56 2009
New Revision: 752219
URL: http://svn.apache.org/viewvc?rev=752219&view=rev
Log:
Add dynamic options
Modified:
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date-input.jsp
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date.jsp
Modified:
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date-input.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date-input.jsp?rev=752219&r1=752218&r2=752219&view=diff
==============================================================================
---
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date-input.jsp
(original)
+++
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date-input.jsp
Tue Mar 10 19:07:56 2009
@@ -6,12 +6,28 @@
<head>
<title>Date Picker</title>
<sjx:head/>
+
+ <script type="text/javascript">
+ var ops = {"maxDate" : "+1m"};
+ </script>
+ <style type="text/css">
+ .someClass {
+ background-color: #c3d9ff;
+ }
+ </style>
</head>
<body>
<s:form id="indexForm" method="post" namespace="/form" action="date"
theme="simple">
- <sjx:datepicker name="date" displayFormat="mm dd yy" theme="jquery-simple"
value="%{date}" readonly="true" imageTooltip="Select a date"/>
- <sjx:datepicker name="date1" displayFormat="mm dd yy"
theme="jquery-simple" value="%{calendar}" readonly="true" imageTooltip="Select
a date"/>
- <sjx:datepicker name="date2" displayFormat="mm dd yy"
theme="jquery-simple" value="%{shortFormat}" readonly="true"
imageTooltip="Select a date"/>
+ Tooltip from a Date: <sjx:datepicker name="date" displayFormat="mm dd yy"
theme="jquery-simple" readonly="true" imageTooltip="Select a date"/>
+ Read only from a Calendar: <sjx:datepicker name="date1" displayFormat="mm
dd yy" theme="jquery-simple" value="%{date}" readonly="true"/>
+ CSS Style: <sjx:datepicker name="date2" displayFormat="mm dd yy"
theme="jquery-simple" value="%{calendar}" cssStyle="background-color:#e5ecf9"/>
+ CSS Class: <sjx:datepicker name="date3" displayFormat="mm dd yy"
theme="jquery-simple" value="%{shortFormat}" cssClass="someClass"/>
+ Short Format: <sjx:datepicker name="date4" displayFormat="mm dd yy"
theme="jquery-simple" value="%{'3/10/09'}"/>
+ Medium Format: <sjx:datepicker name="date5" displayFormat="mm dd yy"
theme="jquery-simple" value="%{'Mar 10, 2009'}" />
+ Large Format: <sjx:datepicker name="date6" displayFormat="mm dd yy"
theme="jquery-simple" value="%{'March 10, 2009'}" />
+ Unparsable Date: <sjx:datepicker name="date7" displayFormat="mm dd yy"
theme="jquery-simple" value="%{'Not a Date'}" />
+ Options from an inline map:<sjx:datepicker name="date8"
theme="jquery-simple" options='{"maxDate" : "+1m"}'/>
+ Options from an object:<sjx:datepicker name="date9" theme="jquery-simple"
options="ops"/>
<s:submit />
</s:form>
</body>
Modified:
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date.jsp?rev=752219&r1=752218&r2=752219&view=diff
==============================================================================
---
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date.jsp
(original)
+++
struts/sandbox/trunk/s2-jquery-showcase/src/main/webapp/WEB-INF/content/form/date.jsp
Tue Mar 10 19:07:56 2009
@@ -5,8 +5,9 @@
<html>
<head>
<title>Posted Date</title>
+<sjx:head />
</head>
<body>
-Date: <span id="date"><s:property value="date" /></span>
+<sjx:datepicker name="date" displayFormat="mm dd yy" theme="jquery-simple"
readonly="true" imageTooltip="Select a date"/>
</body>
</html>
\ No newline at end of file