[Building Sakai] Date Select Widget Help/Advice

Duffy Gillman duffy at rsmart.com
Wed Sep 1 10:07:08 PDT 2010


I am modifying the jobscheduler/scheduler-tool to include a persistent  
DB-backed event log. As part of that work I am developing a filter so  
it is possible to view only events from certain jobs/dates. The tool  
uses JSF. I'm having a heck of a time getting a date select widget to  
work. At present I've tried the sakai:input_date JSF component, and  
have tried the popup calendar from the reports/report-tool module.

Here are the relevant snippets and the troubles I'm running into:

1) sakai:input_date

    Within my form I include this:

	<sakai:input_date id="beforeDatePicker"  
value="#{schedulerTool.eventPager.before}" showDate="true"  
showTime="true"/>

    The date select widget renders, but the image link which should  
produce a calendar to pick from does not work.

    Manually typing in a date causes no errors, but the date is never  
set on the backing bean (schedulerTool.getEventPager().setBefore(...)  
is never called).  EventPager.before is a Date object.

2) popup calendar

    I copied the calendar/ directory (containing javascript, css, and  
several images) into the scheduler-tool WEB-INF directory, then I  
included the following in my JSF page:

    <h:form id="filterForm">

      ...

		<h:inputText id="beforeDateTextArea"  
value="#{schedulerTool.eventPager.before}"
		    onkeypress="return submitOnEnter(event,  
'filterForm:setFilterButton');">
		</h:inputText>
                 <h:outputText escape="false"
                     value="<input type=\"image\" id=\"beforeDatePopup 
\" src=\"images/calendar_icon.gif\"
				   onclick= 
\"jscalendarPopUpCalendar 
(this,this.form.elements['filterForm:dueDateTextArea'],'M/d/yyyy');  
return false;\" />"
                             />

     ...
                  <sakai:button_bar>
                      <sakai:button_bar_item
                                 id="setFilterButton"
                                  
action="#{schedulerTool.processSetFilters}"
                 		value="#{msgs.setFilters}" />
    ...

    The widget preforms fine on screen. The calendar pops up as  
expected and the selected value is properly populated into the text  
area. Unfortunately the submit buttons on the form no longer function!  
The click event is captured somewhere in the javascript and is never  
finally processed by the browser to actually initiate the POST message  
back to the server.

Has anyone run into either of these date select widget woes? Any advice?

Thanks,

    Duffy



More information about the sakai-dev mailing list