Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    v1.2

    I've upgraded to SmartGWT 1.2, and this line from ExtendedCalendar.java is incompatible:

    JSOHelper.setAttribute( eventJS, "viewName", this.getCurrentViewName() );

    The reason appears to be that Calendar.getCurrentViewName() is a removed method in v1.2.
    -Dave


    Originally posted by Laure
    Hi

    Sorry for the delay getaceres.

    Your issue comes from the fact that you didn't call clearCalendarSelection() after cancelling the event. I should have explain it.
    So it should be :
    Code:
    cal.addEventAddHandler(new EventAddHandler() {
    				
    	public void onEventAdd(CalendarEventAdd event) {
    		Window.alert("Creating record");
                    editor.show(event.getStartTime(),event.getEndTime());
    		event.cancel();
    		cal.clearCalendarSelection();
            }
    });
    I added it to be automatically called when you cancel the event in the attached file.
    I also added some features about dates.

    Hope it will help.
    Laure

    Comment


      #17
      Calendar.getCurrentViewName was mistakenly removed in 1.2. It will be added back for 1.2.1. In the meantime please pick up the latest build which has this API.

      Comment


        #18
        Excellent; thanks for the tip!

        Comment


          #19
          Add event by some external way

          Hi, all.
          Now I try (some time) to find a way to handle click into calendar cell body
          (in day or week views) and process this (click) event by my own way.

          I need to add calendar event (I have my own working datasource already),
          but I can't to handle click into (empty) calendar cell body (day,weak).
          After this click I expect that I take a cell time and possibility to process
          this event.

          The handler added by addClickHandler() method doesn't works after click to
          (day,weak) cell body. The handler added by addDayBodyClickHandler() method
          is only for month view.

          Are there some possibilities or suggestions how to solve this problem?
          Thanks for any suggestions.

          Comment


            #20
            Ehh... :-( That sucks, honestly. So nice widget is so screwed... It is so obvious that should be onEventAdd() handler, but for some reasons developers thinks it should not be. To make quince smaller event edit pop-up is also looks impossible (at least I can not find how)...

            These workarounds does not works: available 2.0 version throws new window underneath, once calendar already on a window and other bugs.

            D'oh!

            Comment


              #21
              Originally posted by gwtlaco
              Hi, all.
              Now I try (some time) to find a way to handle click into calendar cell body
              (in day or week views) and process this (click) event by my own way.

              I need to add calendar event (I have my own working datasource already),
              but I can't to handle click into (empty) calendar cell body (day,weak).
              After this click I expect that I take a cell time and possibility to process
              this event.

              The handler added by addClickHandler() method doesn't works after click to
              (day,weak) cell body. The handler added by addDayBodyClickHandler() method
              is only for month view.

              Are there some possibilities or suggestions how to solve this problem?
              Thanks for any suggestions.
              The javadocs of addDayBodyClickHandler do state that the hander is "called when the body area of a day in the month view is clicked on, outside of any links to a particular event."

              Regarding capturing click events on other views, there is an issue file for it. Make sure you star it.

              http://code.google.com/p/smartgwt/issues/detail?id=267

              Comment


                #22
                When I add my own event editing window what API should I call if the user clicks 'OK' button on my new window? I mean how do I add event programmatically so that it is displayed in the calendar?

                I tried to call Calendar.addEvent(_,_,_,_) but it does not work.

                Comment


                  #23
                  hi,
                  I'm new in smartgwt .In my application i am using calendar widget. I want to retrieve the startDate and endDate and description of a newly added event in smart gwt calendar so that i can store it on a database. How can i make this possible by java? Plz help me.

                  Comment


                    #24
                    lots of ways to get the time into the database. you should look at the databinding docs on how to connect smartgwt to a database.

                    if you just want the start/end of a newly added event then

                    Code:
                    		calendar.addEventAddedHandler(new EventAddedHandler() {
                    			
                    			@Override
                    			public void onEventAdded(CalendarEventAdded event) {
                    				Date start = event.getEvent().getStartDate();
                    				...
                    			}
                    		});

                    Comment


                      #25
                      hi, atomatom
                      Thanks. It worked. I could add events for a single day. Now I want to add an event starting from today 11:00 pm and extending the same event to tomorrow 10:00 am. How can I add an event like this? Help me plz...........
                      Last edited by angelrani; 6 Jun 2011, 21:37.

                      Comment


                        #26
                        Hi nazir80

                        I m new in smartGWT.
                        can u please send me ActivityWindow sample code.

                        Thanks

                        Comment


                          #27
                          Just logged in to thank for the code.

                          I do wonder, from the looks of it this is a workaround for the days of SmartGWT 1.5.

                          SmartGWT 3.0 notes mention there are several improvements to the Calendar, does any of those include this functionality?

                          Comment


                            #28
                            Originally posted by pmminov View Post
                            SmartGWT 3.0 notes mention there are several improvements to the Calendar, does any of those include this functionality?
                            Hi! I'm also interested in this question. Is there a way of adding custom event editing window?

                            Thanks in advance!

                            Comment


                              #29
                              complete replacement of the standard event editor

                              Originally posted by Vadimy View Post
                              Is there a way of adding custom event editing window?
                              BackgroundClick event was added since SmartGwt 2.5 and could be used to override default Event Editor, be aware that there's a bug which causes Event click to also raise BackgroundClick event. See this thread to find out more.

                              Code:
                              final Calendar calendar = new Calendar();
                              calendar.setShowQuickEventDialog(false);
                              calendar.setShowAddEventButton(false);
                              calendar.addBackgroundClickHandler(new BackgroundClickHandler() {
                              		
                              		@Override
                              		public void onBackgroundClick(BackgroundClickEvent event) {
                              			event.cancel();
                              			clearCalendarSelection(calendar);
                              			CalendarEvent evnt = new CalendarEvent();
                              			evnt.setStartDate(event.getStartDate());
                              			evnt.setEndDate(event.getEndDate());
                              			editEvent(evnt); // show custom Event Editor
                              		}
                              	};);
                              Code:
                              private native final void clearCalendarSelection(Calendar calendar)/*-{
                              	obj = calendar.@com.smartgwt.client.widgets.BaseWidget::getJsObj()();
                              	obj.clearTimeSelection();
                              }-*/;
                              Last edited by cirovladimir; 21 Mar 2013, 11:29.

                              Comment

                              Working...
                              X