You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pavel Rezny <pa...@tmapy.cz> on 2005/09/27 16:34:08 UTC

How dynamic components could be created?

Hello,
we are a small group of developers creating a multilayer system that 
will process databases and map applications. We decided to build 
user-interface layer using Tapestry, and business-logic layer using 
Spring. The specification of the project requests separating business 
logic layer from user interface layer.

System architecture conforms, from our point of view, to MVC 
(Model-View-Controller) design pattern. Spring components and business 
logics create Model (data and metadata). Tapestry serves as interpreter 
for the Model, and it creates View. Model is thus transferred from 
business logic (Controller) to Tapestry components (View); it contains 
data and metadata in the form of XML document. Model interpretation 
provided by some components of Tapestry (eg. form or table) would enable 
us generate from received data and metadata dynamic outputs.

Here we face difficulties. We tried to create dynamic Template and 
Specification using Delegate class (Template-Source-Delegate, 
Specification-Resolver-Delegate). But at this very moment neither page 
instance exists, nor exist parameters, that should be passed between 
pages in RequestCycle. We use PrepareForRender to retrieve our Model 
from business logic layer.

Is there anybody to give us a piece of advice? Has Tapestry a solution 
how such dynamic components could be created? (those that use data 
passed by another layer) Can Delegate Template use parameters from 
RequestCycle? Or can Delegete be invoked after PrepareForRender has been 
processed?

We look forward to hearing your advice.

Thanks

    Jirka and Pavel

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


RE: How dynamic components could be created?

Posted by Patrick Casey <pa...@adelphia.net>.
	I built some dynamic search forms that introspect the object being
displayed and set up the appropriate list of search widgets based on a
combination of the object properties and some metadata so it can definitely
be done. However, I couldn't find a good way to do it without essentially
shoving Tapestry into a corner and taking control of the process myself.

	So my search component spits out label and input fields via an
HTMLWriter and sets their IDs according to my (not Howard's) naming
convention. Then my form handler (for when the user clicks search) extracts
the values directly out of the session e.g.

		Enumeration en = cycle.getRequestContext().getRequest()
				.getParameterNames();
		while (en.hasMoreElements()) {
			String s = (String) en.nextElement();
			if (s is one of my magic fields)
				...

	It works great, but, since I'm not using Tapestry to set up the
fields for me, I can't use the OOB validation or binding code.

	--- Pat

> -----Original Message-----
> From: Pavel Rezny [mailto:pare@tmapy.cz]
> Sent: Tuesday, September 27, 2005 7:34 AM
> To: tapestry-user@jakarta.apache.org
> Subject: How dynamic components could be created?
> 
> Hello,
> we are a small group of developers creating a multilayer system that
> will process databases and map applications. We decided to build
> user-interface layer using Tapestry, and business-logic layer using
> Spring. The specification of the project requests separating business
> logic layer from user interface layer.
> 
> System architecture conforms, from our point of view, to MVC
> (Model-View-Controller) design pattern. Spring components and business
> logics create Model (data and metadata). Tapestry serves as interpreter
> for the Model, and it creates View. Model is thus transferred from
> business logic (Controller) to Tapestry components (View); it contains
> data and metadata in the form of XML document. Model interpretation
> provided by some components of Tapestry (eg. form or table) would enable
> us generate from received data and metadata dynamic outputs.
> 
> Here we face difficulties. We tried to create dynamic Template and
> Specification using Delegate class (Template-Source-Delegate,
> Specification-Resolver-Delegate). But at this very moment neither page
> instance exists, nor exist parameters, that should be passed between
> pages in RequestCycle. We use PrepareForRender to retrieve our Model
> from business logic layer.
> 
> Is there anybody to give us a piece of advice? Has Tapestry a solution
> how such dynamic components could be created? (those that use data
> passed by another layer) Can Delegate Template use parameters from
> RequestCycle? Or can Delegete be invoked after PrepareForRender has been
> processed?
> 
> We look forward to hearing your advice.
> 
> Thanks
> 
>     Jirka and Pavel
> 
> ---------------------------------------------------------------------
> 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


Re: How dynamic components could be created?

Posted by Chris Nelson <cn...@yahoo.com>.
Hmm, sounds like you are doing something fairly
similar to what I'm doing with Trails.  Check it out
at trails.dev.java.net.  In Trails, I solve the
problem of  needing to dynamically decide how to
render a property by using the Tapestry recommended
approach, Block components.  I have Blocks for each
editor (string, date, number, etc) and choose which
Block to render by the type of the property (or other
metadata).

--Chris

--- Pavel Rezny <pa...@tmapy.cz> wrote:

> Hello,
> we are a small group of developers creating a
> multilayer system that 
> will process databases and map applications. We
> decided to build 
> user-interface layer using Tapestry, and
> business-logic layer using 
> Spring. The specification of the project requests
> separating business 
> logic layer from user interface layer.
> 
> System architecture conforms, from our point of
> view, to MVC 
> (Model-View-Controller) design pattern. Spring
> components and business 
> logics create Model (data and metadata). Tapestry
> serves as interpreter 
> for the Model, and it creates View. Model is thus
> transferred from 
> business logic (Controller) to Tapestry components
> (View); it contains 
> data and metadata in the form of XML document. Model
> interpretation 
> provided by some components of Tapestry (eg. form or
> table) would enable 
> us generate from received data and metadata dynamic
> outputs.
> 
> Here we face difficulties. We tried to create
> dynamic Template and 
> Specification using Delegate class
> (Template-Source-Delegate, 
> Specification-Resolver-Delegate). But at this very
> moment neither page 
> instance exists, nor exist parameters, that should
> be passed between 
> pages in RequestCycle. We use PrepareForRender to
> retrieve our Model 
> from business logic layer.
> 
> Is there anybody to give us a piece of advice? Has
> Tapestry a solution 
> how such dynamic components could be created? (those
> that use data 
> passed by another layer) Can Delegate Template use
> parameters from 
> RequestCycle? Or can Delegete be invoked after
> PrepareForRender has been 
> processed?
> 
> We look forward to hearing your advice.
> 
> Thanks
> 
>     Jirka and Pavel
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


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