2 Replies Latest reply on May 27, 2007 12:41 PM by xie ping

    Tomahawk Scheduler

    Fabio DUO Newbie

      Hello,

      I am try to use the Tomahawk Scheduler. I know it's not recommended to use Tomahawk together with seam. But rightnow Tomahawk is the only libery with a Scheduler component and it fits just perfect into my application. Unfortunatly I am trying to get it working since 2 days with no luck. I hope someone has experinence with it.

      No errors are thrown, but it doesn't react to any model updates and I only see a day view. Without any entries, functionality or something.

      I used the example Model Handler and extended it with Seam annotations
      (@Name) and a Interface.

      At the login time I set it up:

      @In(create = true)
      @Out
      ScheduleHandlerBean scheduleHandler;
      ..........
      ..........
      ScheduleModel model = new SimpleScheduleModel();
      model.setMode(ScheduleModel.MONTH);
      scheduleHandler.setModel(model);
      


      Then i use it:

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:t="http://myfaces.apache.org/tomahawk">
      <head>
      <link href="stylesheet/basic.css" rel="stylesheet" type="text/css" />
      </head>
      <f:view>
       <h:form>
       <!-- The schedule itself -->
       <t:div style="position: absolute; left: 220px; top: 5px; right: 5px;">
       <t:schedule value="#{model}" id="schedule"
       rendered="true" visibleEndHour="18" visibleStartHour="8"
       workingEndHour="17" workingStartHour="9" readonly="false"
       theme="evolution" tooltip="true"/>
       </t:div>
       <!-- The column on the left, containing the calendar and other controls -->
       <t:div style="position: absolute; left: 5px; top: 5px; width: 210px; overflow: auto">
       <h:panelGrid columns="1">
       <t:inputCalendar id="scheduleNavigator"
       value="#{model.selectedDate}" />
       <h:commandButton
       actionListener="#{scheduleHandler.addSampleEntries}"
       value="add sample entries" />
       <h:commandButton
       actionListener="#{scheduleHandler.addSampleHoliday}"
       value="add sample holiday" />
       </h:panelGrid>
       </t:div>
       </h:form>
       <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
      </f:view>
      <ui:debug rendered="true" hotkey="h"/>
      </ui:composition>
      


      But the only thing I see is a day view without any functionality. There are also no errors or warnigs and I have no clue what to try.

      I am using:
      - Seam 1.2 patch 1
      - JBoss 4.0.5
      - myfaces 1.1.6 snapshot from today
      - tomahawk 1.1.5

      I will be happy for any hints or ideas.

      Best regards
      Fabio


        • 1. Binding the Scheduler
          Fabio DUO Newbie

          I've also tried to use the Scheduler with the Binding method. Now I receveid a very strange exception message:

          java.lang.ClassCastException: org.apache.myfaces.custom.schedule.HtmlSchedule cannot be cast to org.apache.myfaces.custom.schedule.HtmlSchedule


          <ui:define name="body">
          
           <h1>Login</h1>
           <p>Please login using any username and password</p>
          
           <h:messages styleClass="message"/>
           <f:view>
           <h:form>
           <!-- The schedule itself -->
           <t:div style="position: absolute; left: 220px; top: 5px; right: 5px;">
           <t:schedule value="#{bindingScheduleHandler.model}" id="schedule1"
           binding="#{bindingScheduleHandler.schedule}"
           rendered="true" visibleEndHour="#{scheduleSettings.visibleEndHour}"
           visibleStartHour="#{scheduleSettings.visibleStartHour}"
           workingEndHour="#{scheduleSettings.workingEndHour}"
           workingStartHour="#{scheduleSettings.workingStartHour}"
           readonly="#{scheduleSettings.readonly}"
           theme="#{scheduleSettings.theme}"
           tooltip="#{scheduleSettings.tooltip}"
           headerDateFormat="#{scheduleSettings.headerDateFormat}"
           compactWeekRowHeight="#{scheduleSettings.compactWeekRowHeight}"
           compactMonthRowHeight="#{scheduleSettings.compactMonthRowHeight}"
           detailedRowHeight="#{scheduleSettings.detailedRowHeight}"
           mouseListener="#{bindingScheduleHandler.scheduleClicked}"
           action="#{bindingScheduleHandler.scheduleAction}"
           />
           <h:outputText value="#{bindingScheduleHandler.mouseActionText}"></h:outputText>
           </t:div>
           <!-- The column on the left, containing the calendar and other controls -->
           <t:div style="position: absolute; left: 5px; top: 5px; width: 210px; overflow: auto">
           <h:panelGrid columns="1">
           <t:inputCalendar id="scheduleNavigator"
           value="#{bindingScheduleHandler.model.selectedDate}" />
           <h:commandButton
           actionListener="#{bindingScheduleHandler.addSampleEntries}"
           value="add sample entries" />
           <h:commandButton
           actionListener="#{bindingScheduleHandler.addSampleHoliday}"
           value="add sample holiday" />
           </h:panelGrid>
           </t:div>
           </h:form>
          </f:view>
          </ui:define>
          </ui:composition>


          Very strang this hole thing. I will try it on the Tomahawk list. I guess it's a Tomahawk problem?

          regards
          Fabio

          • 2. Re: Tomahawk Scheduler
            xie ping Newbie

            i have the same problem,do you have mind?