Ok, so I resolved this issue.

When clicking on a schedule item the scheduler saves the selected state
(i.e. which schedule entry was clicked) into the schedule model then submits
the form. My problem was the model was in request scope and the state is
lost between requests so when the form is posted and the backing bean
re-generated the model was getting re-generated and, therefore, loosing the
state. The resolution: keep the model in request scope but save state across
views using t:saveState.

I purposfully did not want to do this as the model represent highly dynamic
data and I wanted it refreshed on each re-post. A better design (for my
purposes) would be to extend the scheduler to allow it to get/set the
selected item id (which could be preserved in view state) while the model
itself dynamic.

Julian




Jurgen Lust-2 wrote:
> 
> Well, I checked by simply adding some debugging to the action method:
> Just calling log.info("Selected Entry: " +
> getModel().getSelectedEntry()) in the action method printed the correct
> entry...
> 
> I committed the changes, please check out the latest sources and take a
> look at the log file...
> 
> Jurgen
> 
> Op wo, 20-09-2006 te 05:18 -0700, schreef Julian Ray:
>> Hi Jurgen,
>> 
>> I'm back on this and still have not found a resolution.
>> 
>> Looking at the code, example 5 does not return the selected entry but
>> simply
>> identifies that an entry was clicked in the mouse listener and the action
>> method simply returns "success".  Am I missing something here?
>> 
>> Has anybody else got this working and if so, have any code they can
>> share.
>> 
>> 
>> BTW, I am not using facelets.
>> 
>> Thanks
>> Julian
>> 
>> 
>> Jurgen Lust-2 wrote:
>> > 
>> > Have you checked schedule example 5? In that example, the
>> > getModel().getSelectedEntry() returns the correct entry when called
>> from
>> > the action method.
>> > 
>> > Are you using Facelets?
>> > 
>> > Jurgen
>> > 
>> > Op ma, 11-09-2006 te 09:15 -0700, schreef Julian Ray:
>> >> Does anyone have any ideas on this? I've been pulling my hair out over
>> it
>> >> for
>> >> two days now :)
>> >> 
>> >> Thanks
>> >> Julian
>> >> 
>> >> 
>> >> Julian Ray wrote:
>> >> > 
>> >> > I'm having problems getting the clicked entry from the scheduler.
>> The
>> >> > ScheduleMouseEvent is set to SCHEDULE_ENTRY_CLICKED but in the mouse
>> >> > listener event and the action event the
>> getModel().getSelectedEntry()
>> >> is
>> >> > always null and  isEntrySelected() always returns false.
>> >> > 
>> >> > Have I missed something? Do I ahve to select the entry somehow?
>> >> > 
>> >> > Thanks
>> >> > Julian
>> >> > 
>> >> 
>> > 
>> > 
>> > 
>> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Scheduler%3A-Getting-Clicked-Entry-tf2247939.html#a6411997
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to