Hello, I have greate idea to create nice toolTips (hints) for input which get "hint-"+ _resources.getId(). This part is working, now I want to find way how to extend components like textfield and add onBlur method call to toolTip. Anyone could help me?
Source of my tooltip component: package org.stml.stmljms.components; import org.apache.tapestry.ComponentResources; import org.apache.tapestry.MarkupWriter; import org.apache.tapestry.PageRenderSupport; import org.apache.tapestry.TapestryConstants; import org.apache.tapestry.annotations.AfterRender; import org.apache.tapestry.annotations.BeginRender; import org.apache.tapestry.annotations.Environmental; import org.apache.tapestry.annotations.IncludeJavaScriptLibrary; import org.apache.tapestry.annotations.IncludeStylesheet; import org.apache.tapestry.annotations.Parameter; import org.apache.tapestry.ioc.annotations.Inject; import org.apache.tapestry.services.Environment; import org.apache.tapestry.dom.Element; @IncludeJavaScriptLibrary(value = { "${tapestry.scriptaculous}/prototype.js", "${tapestry.scriptaculous}/scriptaculous.js", "${commons.scripts}/Tooltip.js" }) @IncludeStylesheet(value = { "${commons.stylesheets}/Tooltip.css" }) public class MyToolTip { @Parameter(value = "", required = false, defaultPrefix = "literal") private String _value; @Inject private ComponentResources _resources; @Parameter(value = "prop:componentResources.id", defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX) private String _clientId; @Environmental private PageRenderSupport _pageRenderSupport; @Inject private Environment _environment; private String _assignedClientId; void setupRender() { if (_resources.getContainerResources().getMessages().contains( "hint-" + _resources.getId())) { _assignedClientId = _pageRenderSupport.allocateClientId(_clientId); } } @BeginRender void render(MarkupWriter writer) { String hint = ""; if (_resources.getContainerResources().getMessages().contains( "hint-" + _resources.getId())) { Element element = writer.element("div"); element.attribute("id", _assignedClientId); // writer.write("Component " + _resources.getId() + " hint: " + hint); } } @AfterRender void doAfterRender(MarkupWriter writer) { if (_resources.getContainerResources().getMessages().contains( "hint-" + _resources.getId())) { writer.end(); String jsCommand = "new Tip('%s', '%s'"; jsCommand += ", {className: 'tap5c_tooltip'"; jsCommand += ", title: '" + "no title" + "'"; jsCommand += ", effect: '" + "blind" + "'"; jsCommand += "});"; String hint = _resources.getContainerResources().getMessages().get( "hint-" + _resources.getId()); _pageRenderSupport.addScript(jsCommand, _assignedClientId, hint); } } } -- View this message in context: http://www.nabble.com/-T5%3A--extend-input-components-for-tooltips-tp16537225p16537225.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]