Closed uklance closed 10 years ago
The component should have two options. Either set a property or invoke a method with the HTML string.
TML
<t:stitch.tostring value="myValue">tml goes here</t:stitch.tostring>
<t:stitch.tostring handler="myToStringHandler">tml goes here</t:stitch.tostring>
Java
// will contain the html after the tostring component has rendered
@Property
private String myValue;
public ToStringHandler getMyToStringHandler() {
return new ToStringHandler() {
// will be invoked during the rendering of the tostring component
public void onToString(String html) {
// do stuff with html
}
};
}
Capture component + demo added http://tapestry-stitch.uklance.cloudbees.net/capturedemo
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Encoding-a-template-as-a-valid-JSON-String-td5723504.html