Announcement

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

    IButton getSelected() seems like opposite state than internal state

    SmartClient Version: v12.1p_2021-10-22/PowerEdition Deployment (built 2021-10-22)

    We are seeing a difference in how IButton.getSelected() is returning the select state value. I know this is not a test case, but I want to ask this question early in case you have seen and corrected the problem already. The following is a screen grab of the Chrome developer debugger. In it the code line of execution is line 128, being executed following the button.getSelected() check., which must be Boolean.TRUE. But if we look at the internal state of the IButton object the selected state is FALSE.


    Click image for larger version

Name:	ForumSelection_False.png
Views:	20
Size:	159.4 KB
ID:	266808

    We also see the opposite happening too. When the IButton is selected in the UI, and we execute IButton.getSelected() it returns FALSE, when the internal state of selected is TRUE.

    Has something changed in this release? Have we being doing something wrong for years - cause this code hasn't changed in years for us.

    We are trying meanwhile to see if we can generate a test case.


    #2
    The best explanation we have come up with is that what the debugger is showing, due to scope or some other reason, for the 'selected' state of the IButton, is not in fact the actual state. So this is likely a red-herring.

    Is this likely?

    Comment


      #3
      It's not clear if the button is actually misbehaving or leading to an application problem - is it?

      What this looks like is either:

      1. you are looking in the Debugger at the SGWT wrapper object or some other object that doesn't have the current state

      2. you are reacting to an event where the state is not yet updated (eg because it's still possible to cancel the state transition)

      Comment


        #4
        Hi,

        We first believed that the IButton select state mismatch was leading to an application problem, but it was not the case.

        I believe we were in case #1. This lead us down the wrong paths for several hours, so the original purpose of the thread was to ask if the there may be a change in IButton selected behavior, or if there was a debugger state misleading us.

        In the end it seems to have been not initializing the state (.setSelected( true/false) ) correctly of the IButton instance.

        Not a real issue...

        Comment


          #5
          Thanks for following up and letting us know. We appreciate it!

          Comment

          Working...
          X