Announcement

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

    Disabled Tab click?

    SmartClient Version: v9.1p_2014-10-20/PowerEdition Deployment (built 2014-10-20)
    GWT 3.1
    IE-11

    I have a case where we have a TabSet with some tabs disabled and some active. Is there any way for me to capture when a disabled tab is clicked?

    TabSelectedHandler only seems to work with active tabs?

    #2
    The TabSelectedHandler fires when a tab is selected, and clicking on a disabled tab does not select it, so it would not be expected to fire.

    If something is supposed to happen when you click on a disabled tab, you may not want to actually disable these tabs (disabled means non-interactive). If you want to keep them as disabled, then it might also be clearer to the user to provide whatever action you have in mind via another control - one which is not in the disabled appearance - since end users also typically expect disabled controls to be inert.

    Finally though, if you wanted to try to create an interaction on a disabled control, you could try to capture the mouseDown event on the TabSet as a whole (as it bubbles), or use Page-level event handling and detect that the disabled tab was the event target.

    Comment


      #3
      This is a very specific and unique case, our product suite is offered up in Tabs, and our sales team would like to target specific client types to 'tease' them with new products, hence when they click on a disabled tab, we would like to show a popup to call sales and have the tab remain disabled.

      I will look into your suggestions, thanks.
      Last edited by JLivermore; 17 Jul 2015, 04:17.

      Comment


        #4
        Adding a MouseDownHandler to the TabSet does not work for a disabled tab, the MouseDownHandler does not fire.

        Looking through the API on the version we are on, I cannot find a Page.setEvent() method?

        How do I check for Page Level events? Is there an example you can point me too?
        Last edited by JLivermore; 17 Jul 2015, 04:13.

        Comment


          #5
          We'd again recommend not trying to add interactivity to a control that appears disabled.

          However if you want to hack this anyway, you could use the core GWT API Event.addNativePreviewHandler(). This would be an unsupported approach, but should work.

          Comment

          Working...
          X