PDA

View Full Version : [CLOSED] Tooltip truncation issue



NotChris
20 Jul 2009, 5:36 PM
We currently have an issue using tooltips in a Listbox where if you mouseover a tooltip with a larger width than the tooltip above or below in the list that you have just moused over, the size of the tooltip rectangle does not get expanded enough to show the total number of characters. In the attached screenshot, I have just moused over "Posted" and then "Approved". You can see the issue on the "Approved" tooltip. It is pretty basic code.




getListView().addListener( Events.OnMouseOver, new Listener()
{

public void handleEvent( com.extjs.gxt.ui.client.event.BaseEvent be )
{
ListViewEvent le = (ListViewEvent) be;
if( le.getIndex() != -1 )
{
if( getSelected().getItem( le.getIndex() ) != null &&
getSelected().getItem( le.getIndex() ).getName() != null )
{
String name = getSelected().getItem( le.getIndex() ).getName().getString();
getListView().setToolTip( name );
}
}
}
} );



The setToolTip method being called is defined in the gxt Component class as is:



/**
* Sets the component's tool tip.
*
* @param text the text
*/
public void setToolTip(String text) {
if (toolTipConfig == null) {
toolTipConfig = new ToolTipConfig();
}
toolTipConfig.setText(text);
setToolTip(toolTipConfig);
}

sven
21 Jul 2009, 1:54 AM
This is an issue in the approach you are doing. I suggest to use QuickTips inside a listview.

You modifiy the tip after is showed up. You need to manually sync the width. I am closing this isuse.