cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@sun3.oulu.fi>
Subject Re: CalendarPopup.js
Date Mon, 08 Oct 2007 18:12:03 GMT
Peter,

I did the following with cocoon 2.1.9:

in your html page send back to the client:

           <link href="resources/forms/css/forms-calendar.css" 
type="text/css" rel="stylesheet" />
           <script type="text/javascript" 
src="/cocoon/_cocoon/resources/dojo/dojo.js"></script>
           <script type="text/javascript" 
src="/cocoon/_cocoon/resources/ajax/cocoon.js"></script>
           <script type="text/javascript" 
src="/cocoon/_cocoon/resources/forms/js/forms-lib.js"></script>
           <script type="text/javascript"><!--//--><![CDATA[//><!--
             dojo.addOnLoad(forms_onload);
             dojo.require("cocoon.forms.*");
           //--><!]]></script>

           <script type="text/javascript" 
src="mattkruse-lib/AnchorPosition.js"></script>
           <script type="text/javascript" 
src="mattkruse-lib/PopupWindow.js"></script>
           <script type="text/javascript" 
src="mattkruse-lib/OptionTransfer.js"></script>
           <script type="text/javascript" 
src="mattkruse-lib/selectbox.js"></script>
           <script xmlns:i18n="http://apache.org/cocoon/i18n/2.1" 
type="text/javascript" src="mattkruse-lib/CalendarPopup.js"></script>
           <script type="text/javascript" 
src="mattkruse-lib/date.js"></script>
           <script type="text/javascript"><!--//--><![CDATA[//><!--
             var forms_calendar = CalendarPopup();
             forms_calendar.setWeekStartDay(1);
             forms_calendar.showYearNavigation();
             forms_calendar.showYearNavigationInput();
             forms_calendar.setCssPrefix("forms_");
           //--><!]]></script>


Form definition:

     <fd:field id="date_arrival">
       <fd:label>Date of arrival (dd/MM/yyyy):</fd:label>
       <fd:datatype base="date">
         <fd:convertor>
           <fd:patterns>
             <fd:pattern>dd/MM/yyyy</fd:pattern>
           </fd:patterns>
         </fd:convertor>
       </fd:datatype>


Template:

   <ft:widget-label id="date_arrival" />
   <ft:widget id="date_arrival" />

Sitemap:

       <map:match pattern="resources/forms/img/*">
         <map:read src="cocoon://_cocoon/resources/forms/img/{1}" />
       </map:match>

       <map:match pattern="resources/dojo/*">
         <map:read src="cocoon://_cocoon/resources/dojo/{1}" />
       </map:match>

       <map:match pattern="resources/ajax/*">
         <map:read src="cocoon://_cocoon/resources/ajax/{1}" />
       </map:match>

       <map:match pattern="resources/forms/css/*">
         <map:read src="cocoon://_cocoon/resources/forms/css/{1}" />
       </map:match>

       <map:match pattern="resources/forms/js/*">
         <map:read src="cocoon://_cocoon/resources/forms/js/{1}" />
       </map:match>

       <map:match pattern="mattkruse-lib/*">
         <map:read 
src="cocoon://_cocoon/resources/forms/mattkruse-lib/{1}" />
       </map:match>


You can include your own css to overwrite the styling of your form elements.

Hope this helps,
Andre


Peter Sparkes wrote:
> Hi,
> 
> I am trying to use CalendarPopup.js to enable users to enter a date in a 
> simple html form
> 
> I am using cocoon 2.1 10
> 
> Can anybody please send me details of a simple example
> 
> Thanks
> 
> Peter Sparkes
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 
Andre H. Juffer              | Email: Andre.Juffer@oulu.fi
The Biocenter and            | WWW: www.biochem.oulu.fi/Biocomputing/
     the Dep. of Biochemistry | Fax: +358-8-553-1141
University of Oulu, Finland  | Phone: +358-8-553 1161
Triacle Biocomputing         | WWW: www.triacle-bc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message