Announcement

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

    FormItem itemHoverHTML and valueHoverHTML problems

    SmartClient Version: v13.1p_2025-12-23/AllModules Development Only (built 2025-12-23)

    Hello, please try this test case:

    Code:
    isc.DynamicForm.create({
        ID: "testForm",
        width: 200,
        itemHoverWidth: 200,
        fields: [
            {name: "test",
             title: "Test",
             type: "text",
             defaultValue: "foo bar",
             itemHoverHTML : function () {
                 return "item hover";
             }
            }
        ]
    });
    as you can see, I have defined itemHoverHTML, but I only see it appear when I hover over the textBox, whereas I believe it should also appear on the title.

    Additionally, when trying to define valueHoverHTML:

    Code:
    isc.DynamicForm.create({
        ID: "testForm",
        width: 200,
        itemHoverWidth: 200,
        fields: [
            {name: "test",
             title: "Test",
             type: "text",
             defaultValue: "foo bar",
             valueHoverHTML : function () {
                 return "item hover";
             }
            }
        ]
    });
    it seems to me that it does not work at all. Is it a bug, or am I missing something?

    #2
    There is, by design, a separate formItem.titleHoverHTML, since the two hovers are often unrelated.

    Similarly, valueHoverHTML would fire for a statically rendered value, but not for the active editor.

    Comment


      #3
      Hi, yes, I am aware that there is titleHoverHTML for the title.
      However, the presence of valueHoverHTML led me to think that it applied only to the “textBox” part of the FormItem, and that itemHoverHTML applied to the entire FormItem.
      Moreover, the documentation does not specify that valueHoverHTML works only for StaticText (if that is what you mean), and in fact it does not work for me:

      Code:
      isc.DynamicForm.create({
          ID: "testForm",
          width: 200,
          itemHoverWidth: 200,
          fields: [
              {name: "test",
               title: "Test",
               type: "text",
               defaultValue: "foo bar",
               canEdit:false,
               readOnlyDisplay:"static",
               valueHoverHTML : function () {
                   return "value hover";
               }
              }
          ]
      });
      Am I misunderstanding your explanation?

      Comment


        #4
        The docs weren't clear enough here, so we've just added to them.

        You aren't see valueHoverHTML() firing here because you have showClippedValueOnHover set to true (it's the default), so there is basically already a hover defined.

        Here's a quick overview of the 3 hover APIs and how they interact:

        Understanding FormItem Hover Methods: titleHoverHTML vs itemHoverHTML vs valueHoverHTML

        SmartClient FormItems have three hover customization points, each for a different region:

        - titleHoverHTML() - fires when hovering over the item's title/label cell
        - itemHoverHTML() - fires when hovering over the item's main cell (including the textbox/editor area). This is the "catch-all" hover and takes priority when customized.
        - valueHoverHTML() - designed for value-specific hovers, but only fires under specific conditions

        The key interaction involves showClippedValueOnHover, which defaults to true for text-based items:

        | showClippedValueOnHover | Textbox hover handled by |
        |-------------------------|--------------------------|
        | true (default) | itemHoverHTML() |
        | false | No hover shown |
        | null | valueHoverHTML() |

        Additionally, if you customize itemHoverHTML() on the item or form, it always takes priority over valueHoverHTML() for the textbox area.

        To use valueHoverHTML(), you must:
        1. Set showClippedValueOnHover: null
        2. NOT customize itemHoverHTML() on that item or form

        Comment


          #5
          Thanks for the clarification, much appreciated.

          Comment

          Working...
          X