Oleg wrote:
I found a bunch of posts and articles  on dynamic forms but I havent
found any tips on how one can dynamically define wheter the field will
be html-el:text, html-el:img, ......

Bascially something like:
 <html-el:${obj.value.type} property="${obj.value.content}" />

There's no way to that in JSPs; there's no 'eval' mechanism.

Of course a dirty way would be printing out plain html like <input
type="text" :)

Yes, you could do that. Another possibility would be to write a JSP 2.0 tag file containing something like

    <c:choose>
        <c:when test="${type eq 'text'}">
            <html-el:text property="${property}" ...
        </c:when>
        <c:when test="${type eq '...

and invoke it with

    <tag:mytag type="${obj.value.type}"
        property="${obj.value.content}" ...

It's cumbersome (and there are some caveats about calling the HTML tags from a tag file if you want to support optional attributes, which I can describe if you're interested).

The other way would be write a traditional custom tag in Java and have it call into the existing HTML tags to do its work.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to