Hi, this is my loadentries in SimplesScheduleModel.java, can i do  this? Is
this correct? Because it give me error. I want to know if this is the
correct thing to do.



protected Collection loadEntries(Date startDate, Date endDate)
    {

Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        
        List scheduleResult = session.createQuery("select s.cod_id,
s.location, s.comments, s.end, s.start, s.title from " +
                "AddSchedule as s").list();
         
        session.getTransaction().commit();
      
        for(int i = 0; i < scheduleResult.size();i++){
                scheduleItems.add(new
SelectItem(scheduleResult.get(i).toString()));
                
     
        }
         
         return scheduleItems;
    
    }


Tks for all.





Jurgen Lust-2 wrote:
> 
> Hi,
> 
> In order to use a database as the source for the schedule, you need to
> write
> an implementation of the
> org.apache.myfaces.custom.schedule.model.ScheduleModel interface. You can
> extend the class
> org.apache.myfaces.custom.schedule.model.AbstractScheduleModel for
> convenience. Now you just need to implement the methods
> loadEntries(Date,Date) and loadDayAttributes(Date). In the first method,
> you
> load the entries for the specified period of time from the database.
> 
> Jurgen
> 
> 2007/7/31, ignicolist <[EMAIL PROTECTED]>:
>>
>>
>> Hi, i am making a project using myfaces schedule. and everything is
>> working
>> fine, but my problem is how i coud make the the entries of schedule could
>> be
>> read by a database?
>>
>> And how to put the views day,week and moth using the same model? Because
>> if
>> i use diferent models the entries in day view for example dont apear in
>> month view!
>> --
>> View this message in context:
>> http://www.nabble.com/Schedule-tomahawk-tf4192737.html#a11923285
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Schedule-tomahawk-tf4192737.html#a11942757
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to