Announcement

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

    Databound ListGridField HoverCustomizer

    Hi Isomorphic,

    this seems pretty easy and is most likely a widely used feature, but how do I show data from a fetch in a ListGridField hover (using latest 5.1p)?
    I have data that I don't want to gather with the normal ListGrid fetch (1:n data, expansive join), but only on hover.

    This does not work:
    Code:
            setHoverCustomizer(new HoverCustomizer() {
                @Override
                public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                    myDS.fetchData(new Criteria("somefield", value.toString()),
                            new DSCallback() {
                                @Override
                                public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                                    return "something I got from the DSResponse"; /[B]/Void methods cannot return a value[/B]
                                }
                            });
                }
            });
    Thank you & Best regards
    Blama

    #2
    You can't use an asynchrounous technique here, because the customizer is synchronous - you could do it with a custom hover component, as in the #grid_hover_custom sample.

    Comment


      #3
      Hi Isomorphic,

      thank you for the pointer. Exactly what I was looking for.

      Best regards
      Blama

      Comment


        #4
        Hi Isomorphic,

        this might be a silly question, but it seems that I can't get my wanted result (usage of getCellHoverComponent()) without setting myLG.setCanHover(true).

        setShowHoverComponents()-docs:
        When set to true and canHover is also true, shows a widget hovering at the mouse point.
        Doing do disables the perfect default of clipped-value-hovers:
        setCanHover()-docs:
        If true, cellHover and rowHover events will fire and then a hover will be shown (if not canceled) when the user leaves the mouse over a row / cell unless the corresponding field has showHover set to false. If unset or null, the hover will be shown if the corresponding field has showHover:true. If false, then hovers are disabled. Note that standard hovers override clipped value hovers. Thus, to enable clipped value hovers, canHover must be unset or null and the corresponding field must have showHover unset or null as well.
        How can I have custom hovers (myLG.getCellHoverComponent() and myLGF.setHoverCustomizer()) as well as clipped-value-hovers,
        but no hovers, where the value is not clipped, myLG.getCellHoverComponent() returns null and no setHoverCustomizer() is set on the ListGridField?

        Thank you & Best regards
        Blama
        Last edited by Blama; 7 Sep 2016, 08:14.

        Comment


          #5
          Would a ListGridField-level setShowHoverComponents() (not there yet in v10.1p_2016-08-26) method solve the problem?
          I could set this one to true then for the fields I want to show custom hover components for:
          Code:
          myListGridField.setShowHover(true);
          myListGridField.setShowHoverComponents(true);
          Best regards
          Blama
          Last edited by Blama; 7 Sep 2016, 08:16. Reason: version v10.1p_2016-08-26 added

          Comment


            #6
            As you say, it may not be possible to achieve this combination of behaviors without new Field-level APIs.

            One thing to try is setShowClippedValuesOnHover(true), which may help - let us know if it doesn't.

            Comment


              #7
              Hi Isomorphic,

              no this does not help - as hovers are shown always, this includes clipped value hovers.

              Best regards
              Blama

              Comment


                #8
                Ok, we'll add some new functionality to support this in the coming days - we'll update here when it's in place.

                Comment


                  #9
                  Hi Isomorphic,

                  great, thank you. Can you also add this to 5.1p? I'm gonna to change to 6.0p soon, but did not so far.

                  Thank you & Best regards
                  Blama

                  Comment


                    #10
                    As of tomorrow's builds, we've added support for ListGridField.setShowHoverComponents(). To get what you need, do something like this:

                    Code:
                    // by default, only show clipped-value hovers, and nothing else - grid.canHover and showHoverComponents, and field.showHover are all null
                    //grid.setCanHover(null);
                    //grid.setShowHoverComponents(false);
                    grid.setShowClippedValuesOnHover(true);
                    
                    // have some field always show it's default hover, whether the value is clipped or not
                    field.setShowHover(true);
                    
                    // have some field always show a custom hoverComponent
                    field.setShowHover(true);
                    field.setShowHoverComponents(true);

                    Comment


                      #11
                      Hi Isomorphic,

                      could you also add this to 5.1p as written in #9 (it is only in 6.0p so far)? I just tried switching to 6.0p, but it seems there are some unrelated blocks in the road before.

                      Thank you & Best regards
                      Blama

                      Comment


                        #12
                        In this case, as it's a non-intrusive enhancement, yes - it's been added for builds dated September 29 and later.

                        Comment


                          #13
                          Hi Isomorphic,

                          thanks, much appreciated. I know that's not something you like to do.

                          Best regards
                          Blama

                          Comment


                            #14
                            Hi Isomorphic,

                            I just tested with v10.1p_2016-10-01 and the new ListGridField-level hover settings are working as expected.

                            Thanks a lot,
                            Blama

                            Comment

                            Working...
                            X