[EMAIL PROTECTED] wrote:
Don't really see where's the problem. Take a look at the example below: it illustrates a page in a very simple telephone polling application. The poll has multiple questions all of which have any number of offered answers: all lists are read from page bean properties. The "priPrihvati" listener retrieves the information stored in the page variable "odabraniOdgovori" and does what ever it needs to do with it. The form could easily be expanded to handle an arbitrary number of different types of input fields (text, datetime and so on).Hi,
How can I do a dynamic form (a form which content - number and type of
input elements (input fields, checkboxes, ..) is known at runtime) ?
I was thinking about a component, but this component probably cannot have a
html template (which is static). I could certainly print all the component
content in a render method, but how to take adventage of all the tapestry
support for html forms ?
<form jwcid="@Form">
<br/>
<span jwcid="@Foreach" source="ognl:pitanja" index="ognl:rBrPitanje" value="ognl:pitanje">
<span jwcid="@RadioGroup" selected="ognl:odabraniOdgovori[rBrPitanje]">
<span jwcid="@Insert" value="ognl:pitanje.tekst"/><br/>
<span jwcid="@Foreach" source="ognl:getPonudjeniOdgovori(pitanje)" value="ognl:ponudjeniOdgovor">
<input type="radio" jwcid="@Radio" value="ognl:ponudjeniOdgovor"/>
<span jwcid="@Insert" value="ognl:ponudjeniOdgovor.tekst"/><br/>
</span>
</span>
<br/>
</span>
<hr/>
<input type="submit" jwcid="@Submit" label="Prihvati!" listener="ognl:listeners.priPrihvati"/>
</form>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
