Announcement

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

    Checkbox : FormItem.setUncheckedDescription and setCheckedDescription.

    SmartClient Version: v13.0p_2023-04-25/PowerEdition Deployment (built 2023-04-25)

    I must be misinterpreting the Checkbox/FormItem API calls to setCheckedDescription and setUncheckedDescription?

    Code:
    public [URL="https://smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/form/fields/CheckboxItem.html"]CheckboxItem[/URL] setUncheckedDescription(java.lang.String uncheckedDescription)The description shown in a hover when [URL="https://smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/form/fields/FormItem.html#getShowOldValueInHover--"]FormItem.showOldValueInHover[/URL] is enabled and a value represents the unchecked state.
    
    [B]Note : [/B]This is an advanced setting
    
    Parameters:uncheckedDescription - New uncheckedDescription value. Default value is "unchecked"
    What I was attempting to do is to simply change the HOVER content when the box has been checked or unchecked.


    Code:
                       qualifyBy = new CheckboxItem("byCheckBox", "Qualify by Name");
                        qualifyBy.setDefaultValue(false);
                        qualifyBy.setWrapTitle(false);
                        qualifyBy.setShowTitle(true);
                        qualifyBy.setTitleOrientation(TitleOrientation.RIGHT);
                        qualifyBy.setAlign(Alignment.CENTER);
                        qualifyBy.setVAlign(VerticalAlignment.CENTER);
                        qualifyBy.setHoverWidth(300);
                        //qualifyBy.setPrompt("Default Hover");
                        qualifyBy.setShowOldValueInHover(true);
                        qualifyBy.setUncheckedDescription("foo");
                        qualifyBy.setCheckedDescription("bar");
    In this simple case I want the hover to be: "foo" when the box is unchecked, and "bar" when checked.

    I know another way of doing this by defining a changedHandler on the checkbox and when it fires change the hover using the setPrompt("message") depending on if the box is checked or not. But I wanted to believe that these setUncheckedDescription and setCheckDescription would give me a simpler solution.

    Am I missing something?
    Last edited by tece321; 20 Jul 2023, 12:34.

    #2
    The docs need a little additional clarity here - these hovers are actually only active if you are using the showPending feature, which is a feature that applies special styling to pending changes (changes that are not yet saved):

    https://smartclient.com/smartgwt/sho...pending_values

    Checkboxes need a hover with the old value in showPending mode because otherwise it's not quite obvious enough whether the value has been changed.

    The docs kind of allude to the showPending feature but do not quite say that the hovers and only active in that case.

    We are either going to make the hovers work even if showPending is false, or clarify the docs to say that the hovers only appear with showPending.

    You probably just want to use the normal hover APIs here instead of waiting for a new build - or you could instead start using the showPending feature if you like it.

    Comment


      #3
      Quick update - we've changed things so that showOldValueInHover will work if you set it, whether or not showPending is also set.

      Please retest with today's build, dated July 21, or a later one.
      Last edited by Isomorphic; 20 Jul 2023, 22:14.

      Comment


        #4
        Thanks for the reply, and the proposed change, which I believe in future will be easier to use than the handlers. Yes the documentation was a little misleading or ambiguous.

        I did fix our issue using a hover handler, so I don't need to move forward to your latest build to get this functionality.

        Comment

        Working...
        X