I looked into the same issue not to long ago and the best approach I
could come up with was either:

        A)  A massive foreach that wrapped a massive conditional e.g.

        Foreach widget in set
                If widget == editbox
                        <span [EMAIL PROTECTED]" />
                If widget == choicebox
                        Etc...

        B)      Building a "dynacomponent" component that spit out
components in java code when it was give a widget definition.

        The problem with A was that it got uber-big and nasty to work with.
Also, I could never get valid fields and fieldlabels to link up right. The
problem with B is that I couldn't get it to "bind" values properly when I
wanted to use data bound controls.

        All in all, I got sort of stumped and frustrated. The apex of the
problem seemed to be that when you're creating a widget via java code, there
isn't an easy way to ask tapestry to "bind" it to a particular datum such
that it'll work via the rewind cycle.

        Thus, emitting an edit box is easy. Emitting an edit box bound to
"user.firstName" is another matter entirely.

        --- Pat

> -----Original Message-----
> From: Clark, Stephen [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 08, 2005 7:23 AM
> To: [email protected]
> Subject: Creating forms dynamically
> 
> Hi
> 
> I am working on a project where product developers can specify their own
> forms using our design tool.  These forms are then displayed to the user
> at run-time.
> 
> Is there a way to get Tapestry to generate these forms dynamically at
> run-time?? Put another way, rather than specifying the form components
> in .html and .page files, is it possible to generate them
> programmatically using Tapestry API calls?
> 
> Thanks for any help,
> 
> Steve


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

Reply via email to