On Mon, 29 Feb 2016 20:03:05 -0300, David Diaz <d...@viddiaz.com> wrote:
Hi all,
Hi!
Thiago & Jens:
How I'm doing fetching-code-outside is someone writes a .java file that
implements an interface. Say it has function a, b and c they have to
implement. They then compile this into a class, put it into a program and
link it to the set of data they want to render. Then, when using the web
interface the application will detect when its loading the set of data
and load it into its own class (not overwriting), create a new instance
and
then use functions a, b and c to render the data into the webpage. This
is
already working - but currently how it is done is that the user has to
hardcode their HTML into the .class file and do things like \"<div>" +
escapeHTML(data) + "</div>";\ instead of it having a template system
where they could go <div>${data}</div> and then the application would
use the
tapestry template/component system.
It's not a template, but you could pass this interface a MarkupWriter and
then you just create HTML elements through its methods. Something like
this, supposing your interface is called Renderer:
public interface Renderer {
void render(MarkupWriter writer);
....
}
void setupRender(MarkupWriter writer) {
Renderer renderer = ...;
renderer.render(writer);
}
MarkupRenderer is exactly the interface used internally by Tapestry when
rendering a template.
In regards to the Dynamic component, I must have messed up using it.
Still though, the problem would be getting it linked up to the .class
file that
is loaded so that the user could then use tapestry in there (otherwise
the ComponentResources would be the .tml file that loaded it, not the
dynamically loaded one).
The template is tightly linked to its corresponding component or page
class and that's where Tapestry looks for properties.
The stack trace I was getting is here, although I don't think it's really
useful: http://da.viddiaz.com/stacktrace.txt
Actually, it is. It's saying the page or component class related to your
template doesn't have a 'header' property.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org