Announcement

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

    Always show Timeline event resize icons

    SmartClient Version: v10.0p_2015-01-22/Pro Deployment (built 2015-01-22)

    I'm trying to customize the timeline so that events, which can be edited, always show their resize icons (see attached pic).

    Right now, they only show up when you mouse over an event, but I would like them to always be shown. Is this possible?

    Also is it possible to change the resize icon picture from the default?
    Attached Files

    #2
    You can call setUseEventCanvasRolloverControls(false).

    On your second point, there *is* a way of doing this internally - the horizontal and vertical resizers are really autoChildren, but they aren't currently exposed to SmartGWT. We'll consider doing that.

    Comment


      #3
      Great, thank you for the fast reply.

      Comment


        #4
        I can't find setUseEventCanvasRolloverControls, is it a timeline method?

        Comment


          #5
          Ah, sorry, that one's not exposed to SGWT either - we'll add that for tomorrow's builds and follow-up here about the resizer autoChildren after a quick audit.

          Comment


            #6
            Okay great, thank you.

            Comment


              #7
              We've exposed all of this for tomorrow's build. You can setUseEventCanvasRolloverControls(false) and then use setAutoChildProperties() to assign src attributes to "eventCanvasHResizer" and "eventCanvasVResizer".

              Comment


                #8
                I'm still not seeing setUseEventCanvasRolloverControls, I can see the getter but not the setter.

                I'm using SmartClient Version: v10.0p_2015-02-09/Pro Deployment (built 2015-02-09)

                Comment


                  #9
                  We've just exposed the setter - it will be available in tomorrow's builds.

                  Comment


                    #10
                    SmartClient Version: v10.0p_2015-05-17/Pro Deployment (built 2015-05-17)

                    I'm seeing some weird behavior when using timeline.setUseEventCanvasRolloverControls(false);

                    I have made a test case out of one of the showcase examples.

                    As you can see in the attached screenshot, the 3 events with canEdit false have resize controls while 3 of the other events are missing theirs, so it looks like there is some kind of problem with calculating which of the events should show controls.

                    Code:
                    public Timeline getTimeline()
                    {
                        Timeline calendar = new Timeline();  
                        calendar.setHeight(451);  
                        calendar.setStartDate(new Date(112, 5, 2));  
                        calendar.setEndDate(new Date(112, 5, 22));  
                        calendar.setCanEditLane(true);  
                        calendar.setShowEventDescriptions(false); 
                        calendar.setUseEventCanvasRolloverControls(false); 
                        calendar.setDisableWeekends(false);
                        calendar.setEventSnapGap(8 * 60); // snap to 8 hour intervals  
                        calendar.setLaneEventPadding(2); // add a little space around events  
                      
                        HeaderLevel[] headerLevels = new HeaderLevel[]{  
                            new HeaderLevel(TimeUnit.WEEK),   
                            new HeaderLevel(TimeUnit.DAY)  
                        };  
                        calendar.setHeaderLevels(headerLevels);  
                        calendar.setLaneFields(new ListGridField[]{ new ListGridField("title", "Developer", 120)});  
                        calendar.setLanes(TimelineLaneData.getRecords());  
                        calendar.setData(TimelineData.getRecords());  
                        
                        return calendar;
                    }
                    
                    public static class TimelineData {  
                    	  
                        private static CalendarEvent[] records;  
                        private static Date today = new Date(112, 5, 2);  
                        private static int year = today.getYear();  
                        private static int month = today.getMonth();  
                        private static int start = today.getDate();  
                      
                        public TimelineData() {  
                        }  
                        public static CalendarEvent[] getRecords() {  
                            if (records == null) {  
                                records = getNewRecords();  
                            }  
                            return records;  
                        }  
                      
                        public static CalendarEvent[] getNewRecords() {  
                            return new CalendarEvent[]{  
                                    new CalendarEvent(1, "Add new Timeline view", "Add a new calendar Timeline component", new Date(year, month, start + 2), new Date(year, month, start + 8, 23, 59, 59), "darcyFeeney"),  
                                    new CalendarEvent(2, "ListGrid field autoSize", "Complex field-autosizing in ListGrid", new Date(year, month, start), new Date(year, month, start, 23, 59, 59), "kaiKong"),  
                                    new CalendarEvent(3, "PDF Import/Export", "Implement native PDF import/export", new Date(year, month, start + 1), new Date(year, month, start + 5, 23, 59, 59), "garretMonroe"),  
                                    new CalendarEvent(4, "Calculated Fields", "Formula and Summary fields for ListGrid", new Date(year, month, start), new Date(year, month, start + 4, 23, 59, 59), "charlesMadigen"),  
                                    new CalendarEvent(5, "ListGrid cell-level selection", "Implement spreadsheet-like selection in ListGrid", new Date(year, month, start + 7), new Date(year, month, start + 14, 23, 59, 59), "charlesMadigen"),  
                                    new CalendarEvent(6, "Text import", "Server text-import", new Date(year, month, start + 16), new Date(year, month, start + 20, 23, 59, 59), "charlesMadigen"),  
                                    new CalendarEvent(7, "TabIndex enhancements", "Enhance formItem tabindex handling", new Date(year, month, start + 9), new Date(year, month, start + 11, 23, 59, 59), "kaiKong"),  
                                    new CalendarEvent(8, "Visual Builder skin", "Skinning changes", new Date(year, month, start), new Date(year, month, start + 3, 23, 59, 59), "shelleyFewel"),  
                                      
                                    new CalendarEvent(9, "DataSource Transaction-handling", "New transaction features", new Date(year, month, start), new Date(year, month, start + 2, 23, 59, 59), "tamaraKane"),  
                                    new CalendarEvent(10, "New Samples", "Add 20 samples for the following new features: ...", new Date(year, month, start + 4), new Date(year, month, start + 20, 23, 59, 59), "tamaraKane"),  
                                    new CalendarEvent(11, "Localization", "Extend i18n support", new Date(year, month, start + 9), new Date(year, month, start + 14, 23, 59, 59), "darcyFeeney"),  
                                    new CalendarEvent(12, "New Language Packs", "Add these 4 new language packs: ...", new Date(year, month, start + 16), new Date(year, month, start + 18, 23, 59, 59), "darcyFeeney"),  
                                      
                                    new CalendarEvent(13, "ComponentXML", "Add the following features and update documentation: ...", new Date(year, month, start + 5), new Date(year, month, start + 11, 23, 59, 59), "shelleyFewel"),  
                                    new CalendarEvent(14, "TileGrid", "Change styling on builtin tiles as follows: ...", new Date(year, month, start + 14), new Date(year, month, start + 19, 23, 59, 59), "shelleyFewel"),  
                                    new CalendarEvent(15, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 1), new Date(year, month, start + 1, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                                    new CalendarEvent(16, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 8), new Date(year, month, start + 8, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                                    new CalendarEvent(17, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 15), new Date(year, month, start + 15, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                      
                                    new CalendarEvent(18, "Oracle enhancements", "Add the following 11g-specific enhancements: ...", new Date(year, month, start + 5), new Date(year, month, start + 7, 23, 59, 59), "garretMonroe"),  
                                    new CalendarEvent(19, "Client export", "Excel export alterations", new Date(year, month, start + 11), new Date(year, month, start + 14, 23, 59, 59), "garretMonroe"),  
                                    new CalendarEvent(20, "Record Components", "New ListGrid recordComponent modes: ...", new Date(year, month, start + 16), new Date(year, month, start + 20, 23, 59, 59), "garretMonroe"),  
                                    new CalendarEvent(21, "SQLDataSource", "Enhancements to customSQL support", new Date(year, month, start + 2), new Date(year, month, start + 4, 23, 59, 59), "kaiKong"),  
                                    new CalendarEvent(22, "includeFrom", "Update support via includeFrom", new Date(year, month, start + 6), new Date(year, month, start + 8, 23, 59, 59), "kaiKong"),  
                                    new CalendarEvent(23, "FileItem", "Add milti-file upload support", new Date(year, month, start + 14), new Date(year, month, start + 16, 23, 59, 59), "kaiKong"),  
                                    new CalendarEvent(24, "Doc viewer", "Enhance documentation viewer with these additional syntax-hilites: ...", new Date(year, month, start + 18), new Date(year, month, start + 19, 23, 59, 59), "kaiKong")  
                            };  
                        }  
                    }  
                    
                    public static class TimelineLaneData {  
                    	  
                        private static Lane[] records;  
                      
                        public static Lane[] getRecords() {  
                            if (records == null) {  
                                records = getNewRecords();  
                            }  
                            return records;  
                        }  
                      
                        public TimelineLaneData() {  
                        }  
                      
                        public static Lane[] getNewRecords() {  
                            Lane[] lanes = new Lane[]{  
                                getLane("charlesMadigen", "Charles Madigen", "Managers"),  
                                getLane("tamaraKane", "Tamara Kane", "Developers"),  
                                getLane("darcyFeeney", "Darcy Feeney", "Managers"),  
                                getLane("kaiKong", "Kai Kong", "Developers"),  
                                getLane("shelleyFewel", "Shelley Fewel", "Managers"),  
                                getLane("garretMonroe", "Garret Monroe", "Developers")  
                            };  
                            return lanes;  
                        }  
                          
                        private static Lane getLane(String name, String title, String devGroup) {  
                            Lane lane = new Lane(name, title);  
                            lane.setAttribute("devGroup", devGroup);  
                            return lane;  
                        }  
                      
                      
                    }
                    Attached Files

                    Comment


                      #11
                      This is fixed for builds dated May 24 and later.

                      Comment


                        #12
                        SmartClient Version: v10.0p_2015-05-24/Pro Deployment (built 2015-05-24)

                        Thanks, this has fixed some of the problems but I still see some unexpected behavior.

                        My timeline is databound, but after the events have been fetched I'm adding some client side events that are not editable. Whenever I add/update/delete an event, I update these client side events.

                        The problem is that after I update the data in the timeline to include the clientside events I see resize controls on the wrong events and some of the databound events completely lose their ability to be resized.

                        I have tried to isolate the problem in a simple testcase.

                        In the following test-case, resize or move an event to see error:
                        Code:
                        	public Timeline getTimeline()
                        	{
                        	    final Timeline calendar = new Timeline();  
                        	    calendar.setHeight(451);  
                        	    calendar.setStartDate(new Date(112, 5, 2));  
                        	    calendar.setEndDate(new Date(112, 5, 22));  
                        	    calendar.setCanEditLane(true);  
                        	    calendar.setShowEventDescriptions(false); 
                        	    calendar.setUseEventCanvasRolloverControls(false); 
                        	    calendar.setDisableWeekends(false);
                        	    calendar.setEventSnapGap(8 * 60); // snap to 8 hour intervals  
                        	    calendar.setLaneEventPadding(2); // add a little space around events  
                        	  
                        	    HeaderLevel[] headerLevels = new HeaderLevel[]{  
                        	        new HeaderLevel(TimeUnit.WEEK),   
                        	        new HeaderLevel(TimeUnit.DAY)  
                        	    };  
                        	    calendar.setHeaderLevels(headerLevels);  
                        	    calendar.setLaneFields(new ListGridField[]{ new ListGridField("title", "Developer", 120)});  
                        	    calendar.setLanes(TimelineLaneData.getRecords());  
                        	    calendar.setData(TimelineData.getRecords());
                        	    calendar.addEventChangedHandler(new EventChangedHandler() {
                        			
                        			@Override
                        			public void onEventChanged(CalendarEventChangedEvent event) {
                        
                        				addDataToTimeline(calendar);
                        			}
                        		});
                        	    
                        	    return calendar;
                        	}
                        	
                        	public static class TimelineData {  
                        		  
                        	    private static CalendarEvent[] records;  
                        	    private static Date today = new Date(112, 5, 2);  
                        	    private static int year = today.getYear();  
                        	    private static int month = today.getMonth();  
                        	    private static int start = today.getDate();  
                        	  
                        	    public TimelineData() {  
                        	    }  
                        	    public static CalendarEvent[] getRecords() {  
                        	        if (records == null) {  
                        	            records = getNewRecords();  
                        	        }  
                        	        return records;  
                        	    }  
                        	  
                        	    public static CalendarEvent[] getNewRecords() {  
                        	        return new CalendarEvent[]{  
                        	                new CalendarEvent(1, "Add new Timeline view", "Add a new calendar Timeline component", new Date(year, month, start + 2), new Date(year, month, start + 8, 23, 59, 59), "darcyFeeney"),  
                        	                new CalendarEvent(2, "ListGrid field autoSize", "Complex field-autosizing in ListGrid", new Date(year, month, start), new Date(year, month, start, 23, 59, 59), "kaiKong"),  
                        	                new CalendarEvent(3, "PDF Import/Export", "Implement native PDF import/export", new Date(year, month, start + 1), new Date(year, month, start + 5, 23, 59, 59), "garretMonroe"),  
                        	                new CalendarEvent(4, "Calculated Fields", "Formula and Summary fields for ListGrid", new Date(year, month, start), new Date(year, month, start + 4, 23, 59, 59), "charlesMadigen"),  
                        	                new CalendarEvent(5, "ListGrid cell-level selection", "Implement spreadsheet-like selection in ListGrid", new Date(year, month, start + 7), new Date(year, month, start + 14, 23, 59, 59), "charlesMadigen"),  
                        	                new CalendarEvent(6, "Text import", "Server text-import", new Date(year, month, start + 16), new Date(year, month, start + 20, 23, 59, 59), "charlesMadigen"),  
                        	                new CalendarEvent(7, "TabIndex enhancements", "Enhance formItem tabindex handling", new Date(year, month, start + 9), new Date(year, month, start + 11, 23, 59, 59), "kaiKong"),  
                        	                new CalendarEvent(8, "Visual Builder skin", "Skinning changes", new Date(year, month, start), new Date(year, month, start + 3, 23, 59, 59), "shelleyFewel"),  
                        	                  
                        	                new CalendarEvent(9, "DataSource Transaction-handling", "New transaction features", new Date(year, month, start), new Date(year, month, start + 2, 23, 59, 59), "tamaraKane"),  
                        	                new CalendarEvent(10, "New Samples", "Add 20 samples for the following new features: ...", new Date(year, month, start + 4), new Date(year, month, start + 20, 23, 59, 59), "tamaraKane"),  
                        	                new CalendarEvent(11, "Localization", "Extend i18n support", new Date(year, month, start + 9), new Date(year, month, start + 14, 23, 59, 59), "darcyFeeney"),  
                        	                new CalendarEvent(12, "New Language Packs", "Add these 4 new language packs: ...", new Date(year, month, start + 16), new Date(year, month, start + 18, 23, 59, 59), "darcyFeeney"),  
                        	                  
                        	                new CalendarEvent(13, "ComponentXML", "Add the following features and update documentation: ...", new Date(year, month, start + 5), new Date(year, month, start + 11, 23, 59, 59), "shelleyFewel"),  
                        	                new CalendarEvent(14, "TileGrid", "Change styling on builtin tiles as follows: ...", new Date(year, month, start + 14), new Date(year, month, start + 19, 23, 59, 59), "shelleyFewel"),  
                        	                new CalendarEvent(15, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 1), new Date(year, month, start + 1, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                        	                new CalendarEvent(16, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 8), new Date(year, month, start + 8, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                        	                new CalendarEvent(17, "Dev Meeting", "Weekly dev meeting", new Date(year, month, start + 15), new Date(year, month, start + 15, 23, 59, 59), false, "testStyle", "charlesMadigen"),  
                        	  
                        	                new CalendarEvent(18, "Oracle enhancements", "Add the following 11g-specific enhancements: ...", new Date(year, month, start + 5), new Date(year, month, start + 7, 23, 59, 59), "garretMonroe"),  
                        	                new CalendarEvent(19, "Client export", "Excel export alterations", new Date(year, month, start + 11), new Date(year, month, start + 14, 23, 59, 59), "garretMonroe"),  
                        	                new CalendarEvent(20, "Record Components", "New ListGrid recordComponent modes: ...", new Date(year, month, start + 16), new Date(year, month, start + 20, 23, 59, 59), "garretMonroe"),  
                        	                new CalendarEvent(21, "SQLDataSource", "Enhancements to customSQL support", new Date(year, month, start + 2), new Date(year, month, start + 4, 23, 59, 59), "kaiKong"),  
                        	                new CalendarEvent(22, "includeFrom", "Update support via includeFrom", new Date(year, month, start + 6), new Date(year, month, start + 8, 23, 59, 59), "kaiKong"),  
                        	                new CalendarEvent(23, "FileItem", "Add milti-file upload support", new Date(year, month, start + 14), new Date(year, month, start + 16, 23, 59, 59), "kaiKong"),  
                        	                new CalendarEvent(24, "Doc viewer", "Enhance documentation viewer with these additional syntax-hilites: ...", new Date(year, month, start + 18), new Date(year, month, start + 19, 23, 59, 59), "kaiKong")  
                        	        };  
                        	    }  
                        	}  
                        	
                        	public static class TimelineLaneData {  
                        		  
                        	    private static Lane[] records;  
                        	  
                        	    public static Lane[] getRecords() {  
                        	        if (records == null) {  
                        	            records = getNewRecords();  
                        	        }  
                        	        return records;  
                        	    }  
                        	  
                        	    public TimelineLaneData() {  
                        	    }  
                        	  
                        	    public static Lane[] getNewRecords() {  
                        	        Lane[] lanes = new Lane[]{  
                        	            getLane("charlesMadigen", "Charles Madigen", "Managers"),  
                        	            getLane("tamaraKane", "Tamara Kane", "Developers"),  
                        	            getLane("darcyFeeney", "Darcy Feeney", "Managers"),  
                        	            getLane("kaiKong", "Kai Kong", "Developers"),  
                        	            getLane("shelleyFewel", "Shelley Fewel", "Managers"),  
                        	            getLane("garretMonroe", "Garret Monroe", "Developers")  
                        	        };  
                        	        return lanes;  
                        	    }  
                        	      
                        	    private static Lane getLane(String name, String title, String devGroup) {  
                        	        Lane lane = new Lane(name, title);  
                        	        lane.setAttribute("devGroup", devGroup);  
                        	        return lane;  
                        	    }  
                        	  
                        	  
                        	}  
                            
                            private void addDataToTimeline(Timeline timeline)
                            {
                                final Date today = new Date(112, 5, 2);  
                                final int year = today.getYear();  
                                final int month = today.getMonth();  
                                final int start = today.getDate(); 
                                
                                List<CalendarEvent> currentData = new ArrayList<CalendarEvent>();
                                
                                // only add events that are not "client side"
                            	for (CalendarEvent calendarEvent : timeline.getData()) {
                        			if(!"testStyle".equals(calendarEvent.getAttribute("eventWindowStyle")))
                        				currentData.add(calendarEvent);
                        		}
                            	
                            	// add some new client side events
                            	currentData.add(new CalendarEvent(25, "New Event 1", "new event", new Date(year, month, start + 14), new Date(year, month, start + 16, 23, 59, 59),false, "testStyle", "kaiKong"));
                            	currentData.add(new CalendarEvent(26, "New Event 2", "new event", new Date(year, month, start + 18), new Date(year, month, start + 19, 23, 59, 59),false, "testStyle", "kaiKong"));
                        
                            	timeline.setData(currentData.toArray(new CalendarEvent[currentData.size()]));
                            	timeline.getSelectedView().rebuild();
                            }

                        Am I doing something wrong or do I need to do something else than timeline.getSelectedView().rebuild(); after i change the data in the timeline.
                        Attached Files

                        Comment


                          #13
                          Have you been able to reproduce this?

                          It is important that I get this to work because my timeline currently stops working as soon as a user starts to edit events.
                          Please let me know if you need any more information or anything else to make the issue more clear.

                          Comment


                            #14
                            Yes, sorry, a fix was made on 24th but we neglected to let you know.

                            Comment


                              #15
                              SmartClient Version: v10.0p_2015-05-27/Pro Deployment (built 2015-05-27)

                              I have updated to the latest build but I'm still seeing the same problem with the above test case.

                              To iterate, the problem occurs when you resize/move an event in the timeline which triggers the EventChangedHandler and adds more events to the timeline.

                              Comment

                              Working...
                              X