On 8/4/05, Matthias Marschall <[EMAIL PROTECTED]> wrote:
> Is it possible that a JSF custom renderer produces JSP tags, which can
> then be evaluated again?
>
> E.g. in the renderer encodeEnd():
>
> writer.write("<h:form ...>");
>
> If we try this, we get <h:form ...> in our html. We would like to find
> any way to make the JSP engine evalute the output of our renderer to
> produce the <form ...> tag in html.
>
You'd essentially have to run the JSP compiler at runtime on every
request for something like this to work. NOT a good idea for
performance, even if it were a good architectural approach -- which I
don't believe it is.
> Any ideas?
>
If you want to dynamically compose child components, why not just add
them to the component tree programmatically?
Assume you have an outer component to which you want to dynamically
add a form with a bunch of fields, where you don't know which ones
you'll need ahead of time. Something like this will work:
OuterComponent outer = ...; // Get reference to the component that
will be the parent
HtmlForm form = new HtmlForm();
form.setId("form1");
form.setXxx(...); // Set other properties
outer.getChildren().add(form);
; // Do the same thing adding children to the form
When you're through, the components you just created can render
themselves. The only tricky detail to remember is that the outer
component has to return true for the rendersChildren property.
> Matthias
Craig