PDA

View Full Version : Custom ToolTip to heigh



Olaus
7 Feb 2012, 1:39 AM
(Beta 2) I'm trying to customize a tooltip, but the tooltip gets to heigh.
It looks like this.

31425
But should look like this

31426

TestCase:


public class ToolTipTest {
public interface Renderer extends ToolTipConfig.ToolTipRenderer<String>,
XTemplates {
@Override
@XTemplate("<div>TEST</div>")
public SafeHtml renderToolTip(String data);
}
public void setup() {
TextButton button = new TextButton("test");
ToolTipConfig ttc = new ToolTipConfig();
Renderer renderer = GWT.create(Renderer.class);
ttc.setRenderer(renderer);
ttc.setCloseable(true);
button.setToolTipConfig(ttc);
RootPanel.get().add(button);
}
}

PhiLho
7 Feb 2012, 3:45 AM
I tried your code. The problem is that your template is rendered in a <span> element, which can accept only inline children, so the generated code is incorrect (at least for XHTML (http://www.w3.org/2010/04/xhtml10-strict.html)).
With a @XTemplate("<span>TEST</span>"), it is displayed correctly.

Olaus
7 Feb 2012, 5:08 AM
Thanks for the responce.
The problem is my custom tip is more complex than the one in the testcase. It contains some nested divs.
(I used <span> to produce the "correct" screenshot)

The problme is also visible in the explorer demo for the custom toolip
http://sencha.com/examples-dev/#ExamplePlace:tooltips

Olaus
7 Feb 2012, 5:32 AM
I got this working now.
My workaround was to create a custom TipAppearence with my own template where the span is replaced by a div.
I still think it's a bug that should be corrected.