Announcement

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

    Need tooltip on focus(not on hover) of FormItem

    Hi,
    Tooltips are showing only when mouse over on any FormItem. I want tooltip on focus of FormItem(not hover) ie., In general, ppl wont hover every time on a Form having more items. They just go to next text item/SelectItem/whatever, just by pressing Tab. In this case im not seeing tooltip in UI.

    I tried setHint() but it is showing the tooltips/msgs on Form load itself. So i just need tooltip kind of functionility ie., auto hide when loses focus. How can i acheive this?

    Im using :
    SmartClient Version: SC_SNAPSHOT-2011-08-02/LGPL Development Only (built 2011-08-02)

    #2
    Anybody have suggestions on this?

    Comment


      #3
      Hey man, next time try to be more clear. I had to read 4 times your post to understand it.

      Try using addFocusHandler on formItem and create your own tooltip.

      Cheers.

      Comment


        #4
        Dude,
        Thanks for the reply. In addFocusHandler, in which way i need to show the tool tip, that is, if is use code like below:
        Code:
        nameField.addFocusHandler(new FocusHandler() {
        			
        			@Override
        			public void onFocus(FocusEvent event) {
        				Log.debug("focusssssss..........");
        				nameField.setTooltip("temppppppp : ");
        				
        				
        			}
        });
        Im getting the tooltip on mouseover but this is not what i want. If i use setHint() in place of setTooltip(), its occupying the space in UI and existing UI gets distracted, but tooltips wont occupy any space in UI and they wont affect existing UI. They will come on the fly and goes off. My problem is how to show the tooltip on key press/focus of text item(not on mouse hover) and keep showing the tooltip until user leaves the text item. Hope you understand now.

        Comment


          #5
          what your code below do :

          When a user focus the nameField you SET the tooltip on this field. Tooltips are triggered when the user mouseon the field.

          If you want your own tooltip, code it yourself.

          Hints :
          - When you get the onFocus event, create a canvas containing the content you want.
          - When you get the onLostFocus event, hide this canvas.

          Maybe you don't need to code everything, look in the Javadoc for "Hover".

          Cheers

          Comment

          Working...
          X