You are ending the <a> element before the inner <img> (etc) renders.
Instead, you should end the writer in afterRender:
void afterRender(MarkupWriter writer)
{
writer.end(); // <a>
}
The corelib components are good examples to copy.
Cheers,
Nick.
Angelo Chen wrote:
Hi,
I have a component :
public class ImgDlg2 {
@Parameter(required=true)
private String _path;
boolean beginRender(MarkupWriter writer)
{
if (_path != null)
writer.element("a", "href", _path);
else
writer.element("a", "href", "#");
writer.end();
return true;
}
}
template: <t:imgDlg2 path="currentImage.Photo.thumbnail_m2" >< img
src="test"/> </t:imgDlg2>
I was hoping it will generate < a href="tm_3098.jpg">< img src="test" /><
/a>
but turned out:
< a href="tm_3098.jpg">< /a>< img src="test">
anything wrong with my component? Thanks.
A.C.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]