Announcement

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

    Cell hovers not working for Timeline

    Hi Isomorphic,

    I am trying to show cell hovers for a lane field cell only when its value is clipped using the timelineView autochild, however, the following code doesn't work as expected.

    Code:
    CalendarView timelineViewProperties = new CalendarView();
    timelineViewProperties.setCanHover(null);
    timelineViewProperties.setShowClippedValuesOnHover(Boolean.TRUE);
    timeline.setAutoChildProperties("timelineView", timelineViewProperties);
    After doing some investigation it doesn't look like hovers are working at all for either lane field cells or normal cells.

    Here is my sample code:
    Code:
    public void onModuleLoad() {
        VLayout layout = new VLayout();
        layout.setWidth100();
        layout.setHeight100();
        layout.addMember(getTimeline());
        layout.draw();
    }
    
    private Timeline getTimeline() {
        Timeline timeline = new Timeline();
        timeline.setCellHoverCustomizer(new CellHoverCustomizer() {
    
            @Override
            public String getHoverHTML(ListGridRecord record, int rowNum, int colNum, Date date, String defaultValue, CalendarView view) {
                return "Custom hover message.";
            }
        });
        timeline.setHeight(600);
        timeline.setShowViewHovers(Boolean.TRUE);
        timeline.setShowCellHovers(Boolean.TRUE);
        timeline.setShowLaneFieldHovers(Boolean.TRUE);
    
        // set up the grid
        ListGridField titleField = new ListGridField("title", "Title", 120);
        timeline.setLaneFields(titleField);
        timeline.setLanes(new Lane("lane1", "Lane 1"));
    
         return timeline;
    }
    Is this a defect or is there something else I need to enable?

    Thanks


    #2
    I am using SmartClient Version: v12.1p_2023-01-08/Pro Deployment (built 2023-01-08).

    Comment


      #3
      Thanks for the notification. We have a developer taking a look at this and will follow up when we have more information

      Regards
      Isomorphic Software

      Comment


        #4
        We've made a fix to address this issue and you can try it out in today's builds, dated January 26, or a later one.

        Comment


          #5
          Isomorphic,

          The cell hovers are working for lane field with the Jan 26 build, however, I have escapeHTML set to true for the title field but it's not escaping the name in the hover like it does for a standard ListGrid.

          Also, is there anyway to always escape HTML for the event name/description for the default event canvas and hover? I am currently using StringUtil.asHTML on the name when creating the event.

          Thanks.

          Comment


            #6
            We've made a change to have field.escapeHTML work as expected for (laneField) cell and header-hovers - you can try that out in today's builds, dated January 30 or later.

            We'll discuss what to do about escaping EventCanvas hovers and let you know how we'll implement it shortly.

            Comment


              #7
              For EventCanvas escaping, we've added EventCanvas.escapeHTML, which you can set via the Calendar.eventCanvas autoChild - it will escape event-details like name and description in default HTML, in both EventCanvas content and hovers.

              If you're customizing HTML at runtime, all customization pathways are passed a defaultValue - if any of those pathways return a value other than the defaultValue they were passed, the returned value is escaped in its entirety.

              You can test this out in today's builds as well.

              Comment


                #8
                I have confirmed that the value is escaped in the lane field cell hover with the Jan 31 build. Also, the EventCanvas escaping is working like a charm. Thanks!

                Comment

                Working...
                X