• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with Tomahawk's schedule component

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In our project we are using tomahawk inputCalendar and schedule component. The schedule is populated properly according to the selected date.
When I click on any entry in the schedule, its throwing NullPointer Exception as the ScheduleEntry is null.

Please find the code below.
<f:view>
<h:form>
<!-- The schedule itself -->
<t:div style="position: absolute; left: 220px; top: 5px; right: 5px;">
<t:schedule value="#{ViewAppointmentsBean.model}" id="schedule1"
binding="#{ViewAppointmentsBean.schedule}"
rendered="true" visibleEndHour="18" visibleStartHour="8"
workingEndHour="17" workingStartHour="9" readonly="false"
theme="default" tooltip="true"
action="#{ViewAppointmentsBean.createScheduleAction}" submitOnClick="true"
mouseListener="#{ViewAppointmentsBean.modifyNotes}" />
</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="#{ViewAppointmentsBean.model.selectedDate}"
valueChangeListener="#{ViewAppointmentsBean.displayDay}" readonly="false"/>
</h:panelGrid>
</t:div>
</h:form>
</f:view>

ViewAppointmentsBean backing bean code,

public String createScheduleAction() {
ScheduleEntry entry = this.model.getSelectedEntry();
if(entry == null)
System.out.println("createScheduleAction entry null.....");
else
System.out.println("createScheduleAction entry not null.....");
return "success";

}

public void modifyNotes(ScheduleMouseEvent e) {
try{
if(e == null)
System.out.println("ScheduleMouseEvent nullll.......");
schedule = e.getSchedule();
if(schedule == null)
System.out.println("schedule nullll.......");

ScheduleEntry entry = schedule.getModel().getSelectedEntry();
if(entry == null)
System.out.println("entry nullll.......");

} catch(Exception eX){
eX.printStackTrace();
}

}

Just for testing I have removed all the other logic, given println statements. The output I am getting in the console is
entry nullll.......
createScheduleAction entry null.....

We are using MyFaces 1.1.5 and Tomahawk 1.1.9.

Thanks in advance.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic