hunthu2000 / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

Have MonthView's + n more label have an event fired with clicked #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a calendar // view = new Calendar(); ..
2. Set month view // view(CalendarViews.MONTH);
3. Add more than one appoints on a given day

What is the expected output? What do you see instead?

The "+ n more" label is a clickable link with a callback I can implement some 
behavior with

What version of the product are you using? On what operating system?

gwt-cal-0.9.0-beta1.jar on osx

Please provide any additional information below.

snippet from MonthView.java

if (exceedMaxAppointmentsPerCell(maxMultiDay, i)) {

// either make this a link or add a click listener with a callback that the 
client can handle
                        Label more = new 
Label(MESSAGES.monthView_MoreAppointmentsInDay(count - i));
                        more.setStyleName(MORE_LABEL_STYLE);
                        placeItemInGrid(more, dayOfWeek, dayOfWeek,
                                weekOfMonth, calculatedCellAppointments);
                        appointmentCanvas.add(more);
                        break;
                    }

Original issue reported on code.google.com by d.tang...@gmail.com on 21 Jan 2010 at 6:09

GoogleCodeExporter commented 9 years ago
We'll add in an event handler... i'm thinking something like this:

calendar.addDateRequestHandler(new DateRequestHandler<Date>(){
  @Override
  public void onSelection(DateRequestEvent<Date> event) {
    ...
  }
});

The event would get fired when a user "requests" to change the date (hence the 
DateRequestEvent name). In the case of the monthView the user would request to 
change 
the date by clicking the "+ n more" label.

This could also work for an AgendaView. The AgendaView "groups" appointments by 
date. 
So if a user clicks that date, the event could be fired, and the developer 
could 
choose to switch to the DayView for that date (that is how google calendar 
works).

Make sense? Is that what you were thinking?

What about you Carlos?

Original comment by Brad.Ryd...@gmail.com on 21 Jan 2010 at 7:55

GoogleCodeExporter commented 9 years ago
sounds great

Original comment by d.tang...@gmail.com on 25 Jan 2010 at 1:41

GoogleCodeExporter commented 9 years ago
Has anyone had a chance to look at this yet?

Original comment by d.tang...@gmail.com on 29 Jan 2010 at 6:01

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 4 Feb 2010 at 6:33

GoogleCodeExporter commented 9 years ago
This feature was added in svn. You may want to try it out. See the "Date 
Request Event" 
details in the WIKI
http://code.google.com/p/gwt-cal/wiki/HandlingEvents

Original comment by Brad.Ryd...@gmail.com on 18 Feb 2010 at 10:40

GoogleCodeExporter commented 9 years ago
works great! thanks brad.

fyi the  wiki says public void onSelection(DateRequestEvent<Date> event) when 
the signature is actually public 
void onDateRequested(DateRequestEvent<Date> event) 

Original comment by d.tang...@gmail.com on 18 Feb 2010 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 27 Mar 2010 at 10:46

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 12 May 2010 at 7:12