Hi John,
If my question is stupid or makes incorrect assumptions, feel free to
completely ignore me. My question relates to render and how the
SafeHtmlBuilder is constructed:
@Override
public void render(Context context, SafeHtml data, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<button type=\"button\" tabindex=\"-1\">");
if (data != null) {
sb.append(data);
}
sb.appendHtmlConstant("</button>");
}
At a glance, this seems to imply that any inner content has to already be
"baked" HTML. To me, that seems to imply that for a complex hierarchy, you
have to construct a bunch of SafeHtmlBuilders as you go, bake them, and pass
the result into yet more builders. I don't know how this fits into the
existing model, but would it be possible to do something more visitor like?
@Override
public void render(Context context, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<button type=\"button\" tabindex=\"-1\">");
context.doChildren(sb);
sb.appendHtmlConstant("</button>");
}
In effect, you run the SafeHtmlBuilder in 'one shot'.
Just a comment from the peanut gallery, :)
Scott
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors