You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by RR <se...@gmail.com> on 2004/10/06 21:10:35 UTC

Suggestions needed: Componentized Forms?

I'm soliciting suggestions for the following situation:
Customer has an extremely large form which we've convinced them to
"componentize" to allow navigation (tabs or links). Current line of
thinking is to create multiple components, which would really be their
own specific forms (1 per tab) embedded into a page (along the lines
of a Border). BUT, I'm wondering how I can create these components
since they would seem a mix of a page and a real Tapestry component.
I'm still quite new at this so I'm looking for suggestions...

Second part is, if they really want all of these forms to appear on a
master page (quite a long page) what are any suggestions of how to go
about "gluing" them all together?

Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Suggestions needed: Componentized Forms?

Posted by Shawn Church <sh...@boxity.com>.
I've done something very similar to this recently, and it actually worked
very well.  I have a "main" page (not a component) which conditionally
renders all appropriate components depending on my application state.  The
components themselves are built exactly like normal pages, except they
cannot be activated in the same way (eg. cycle.activate(page)).

Each of these components implements PageRenderListener like a normal page,
and therefore pageBeginRender can be implemented as usual.  There are a
couple of important caveats however you may want to consider.

First, all page listeners are notified (as they should be) whether or not
the component in question is actually destined to be rendered, even if the
components are enclosed by @Conditional.  So for example, if you have six
components which are referenced on a page (whether @Conditionally or not),
and each of them implements PageRenderListener, pageBeginRender will be
invoked on every cycle for each of the six components.  This may not be a
problem in your case (especially if the components are unconditionally
rendered, as in one huge page with lots of componentized forms).  In my case
(where application state was critical), I had to essentially synchronize my
pageBeginRender logic with my @Conditional page rendering logic, because I
didn't want my components preparing to render when my page @Conditionals
would ultimately discard their output anyway.  If your components do not
need to be page listeners, then they shouldn't implement PageRenderListener.
If they do, then your @Conditional conditions and your pageBeginRender
conditions should use the same methods to determine page/application state.

Secondly, you may need to devise a strategy of inter-component communication
if your various forms are intended to work together seamlessly (ie - as a
single page).  It would not be uncommon for some of your components to
depend upon other component data, so you may want to keep this in mind.  If
they operate fairly independently (as you mention one per tab), then this
may be less of an issue for you.

If I had to develop this app again, I would do it the same way.  My
application was a very complex wizard-like product configurator which needed
to be compressed into what appeared to be a single page, and it would have
been terribly ugly to physically put everything into a single .html template
(it would have been thousands of lines of html).  My java code would have
been somewhat less complex, but the trade-off was worth it to me.

Shawn


-----Original Message-----
From: RR [mailto:security.identity@gmail.com]
Sent: Wednesday, October 06, 2004 2:11 PM
To: tapestry-user@jakarta.apache.org
Subject: Suggestions needed: Componentized Forms?


I'm soliciting suggestions for the following situation:
Customer has an extremely large form which we've convinced them to
"componentize" to allow navigation (tabs or links). Current line of
thinking is to create multiple components, which would really be their
own specific forms (1 per tab) embedded into a page (along the lines
of a Border). BUT, I'm wondering how I can create these components
since they would seem a mix of a page and a real Tapestry component.
I'm still quite new at this so I'm looking for suggestions...

Second part is, if they really want all of these forms to appear on a
master page (quite a long page) what are any suggestions of how to go
about "gluing" them all together?

Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org