You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Rhodes, Phillip C." <Ph...@alcoa.com> on 2003/06/02 22:05:55 UTC

general tapestry question

Hi everyone,
I am struggling.  I have been a java developer since 1.0.1 and in the
servlets world since they came out.
However, I am struggling hard with tapestry (trying to understand it).  But
I continue on working at it because there is no going back.  I know there
must be a better way than struts.

I am still trying to get "tapestry", and how it can be applied in my
day-to-day development work.  I have the following questions:

In the border component, the new page property is set in the following
method:

public void selectPage(IRequestCycle cycle)
{
Object[] parameters = cycle.getServiceParameters();
String newPageName = (String) parameters[0];
Visit visit = (Visit) getPage().getEngine().getVisit(cycle);
visit.setActiveTabName(newPageName);
cycle.activate(newPageName);
}


Coming from the struts frame of mind, I would be able to specify a bean at
the request or session level with a property that represented the currently
selected page.  The property would automatically be stored for this bean if
it were in a struts form.  In tapestry, it appears that I have to abstract
the pagename from the cycle (request) and store it in the visit (session).  

question:
Is this because the Border is a component, and this extra crossover work to
take something from the request to the session is something the developer
needs control over?

It appears that tapestry takes care of automatically populating the
properties for page objects. 

questions:
Can I put my own custom beans in the page object and specify via ognl how to
populate my nested object properties?

Are the properties of a page object request scope, or session scope?  How
does one specify one or the other?

Thanks very much.






RE: general tapestry question

Posted by Adam Greene <ag...@romulin.com>.
There are several answers to your question:

1.  You can do whatever you want with hidden fields with a form (which is
the simplest way to hand information around within a form) and the hidden
will automatically popuplate the fields attached to it (we use it to run
stateless within several of our apps, it doesn't matter what page they are
on, the hidden tells us what to do).

2.  The reason for the way it is done within Border component is because the
border component is NOT inside a form (Tapestry enforces strict HTML
conformance).  It also has to perform several behind the scenes tasks
triggered by setActiveTabName, and because you don't do a form submit, the
only other logical way of going to a new page would be with a URL, and
because the page the Border is in, is actually only one page, how would it
know which "page" to render without some special information (the "page" is
actually several components that are activated based on the state set by
setActiveTabName).

-----Original Message-----
From: Rhodes, Phillip C. [mailto:Phillip.Rhodes@alcoa.com]
Sent: Monday, June 02, 2003 5:06 PM
To: Tapestry users
Subject: general tapestry question


Hi everyone,
I am struggling.  I have been a java developer since 1.0.1 and in the
servlets world since they came out.
However, I am struggling hard with tapestry (trying to understand it).  But
I continue on working at it because there is no going back.  I know there
must be a better way than struts.

I am still trying to get "tapestry", and how it can be applied in my
day-to-day development work.  I have the following questions:

In the border component, the new page property is set in the following
method:

public void selectPage(IRequestCycle cycle)
{
Object[] parameters = cycle.getServiceParameters();
String newPageName = (String) parameters[0];
Visit visit = (Visit) getPage().getEngine().getVisit(cycle);
visit.setActiveTabName(newPageName);
cycle.activate(newPageName);
}


Coming from the struts frame of mind, I would be able to specify a bean at
the request or session level with a property that represented the currently
selected page.  The property would automatically be stored for this bean if
it were in a struts form.  In tapestry, it appears that I have to abstract
the pagename from the cycle (request) and store it in the visit (session).

question:
Is this because the Border is a component, and this extra crossover work to
take something from the request to the session is something the developer
needs control over?

It appears that tapestry takes care of automatically populating the
properties for page objects.

questions:
Can I put my own custom beans in the page object and specify via ognl how to
populate my nested object properties?

Are the properties of a page object request scope, or session scope?  How
does one specify one or the other?

Thanks very much.






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