Programming__WebObjects-Web Applications-Development-Examples-Calendar Component

Version 2.1 by smmccraw on 2007/07/08 09:45

Here is a little example on how to write a "calendar" component:

So you have a specific month, some of the dates are links (that will depend on what the calendar is for) and some basics navigations (next/previous month, year).

That's how the html could look like:


{panel}
 <webobject name = "Table">
   <tr>
     <td align = "left" valign = "top" colspan = "7">
       <webobject name = "Month"></webobject>
       <webobject name = "HasNavigation">
         &nbsp;<webobject name = "YearLink"><webobject name = "Year"></webobject></webobject>
       </webobject>
     </td>
   </tr>
   <webobject name = "Rows">
     <tr>
       <webobject name = "Columns">
         <td align = "right" valign = "top">
           <webobject name = "HasLink">
             <webobject name = "IsCurrentDay"></webobject><webobject name = "Link"><webobject name = "Day"></webobject></webobject><webobject name = "IsCurrentDay"></webobject>&nbsp;
           </webobject>
           <webobject name = "HasNoLink">
             <webobject name = "Day"></webobject>&nbsp;
           </webobject>
         </td>
       </webobject>
     </tr>
   </webobject>
   <webobject name = "HasNavigation">
     <tr>
       <td align = "left" valign = "top" colspan ="3">
         <webobject name = "HasPreviousMonth">
           <small><webobject name = "PreviousMonthLink"><webobject name = "PreviousMonth"></webobject></webobject></small>
         </webobject>
       </td>
       <td align = "left" valign = "top">
         &nbsp;
       </td>
       <td align = "right" valign = "top" colspan ="3">
         <webobject name = "HasNextMonth">
           <small><webobject name = "NextMonthLink"><webobject name = "NextMonth"></webobject></webobject></small>
         </webobject>
       </td>
     </tr>
   </webobject>
 </webobject>
{panel}

And here is the wod:

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

The component implementation is left to the imagination of the reader.

Category:WebObjects