You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Ebersole, Steve" <st...@vignette.com> on 2004/02/24 14:31:54 UTC
first tapestry app
I am starting my first Tapestry application, meant as a POC for my bosses regarding use of Hibernate and the Spring Framework together with Tapestry as an approach for application building. But, of course, I quickly ran into a couple of questions regarding usage and best-practices (any ideas when the new user docs will be ready?).
1) Is there a recommended directory layout for the .page and .html files? Should the .page files be kept "inline" with the corresponding IPage impls within the package structure? Most of the example apps I have seen keep them bundled with the corresponding .html files, but that seems to break the seperation of concern to me, newb that I am.
2) In the .application file, does each page need to be explicitly listed using the <page/> element? It seems like you would need to if/when the .page files are not kept in the context root. But maybe even then you could reference the page via its context-path. I'm a little uncertain here.
3) In trying to use the contrib:Table component, I'm kind of stuck. Based on the component docs, I am initially trying to use the source/columns definition approach but I keep getting complaints that the columns value I pass in cannot be parsed. What I have is:
<component id="results" type="contrib:Table">
<binding name="source" expression="userList" />
<binding name="columns" expression="userName:UserName:userName,firstName:First Name:firstName,lastName:Last Name:lastName,email:Email:email" />
</component>
trying to use the id:description:expression column definition type. However, I keep getting OGNL parse exceptions as soon as it comes across the first ":".
4) Still related to the Table component, whats the best way to element selection from a Table (i.e., say to go to a detail record for that row)? Should I manually build up the individual table-model components and include an impl of IRender for the ITableColumn.getValueRenderer() property which wraps the cell value in an appropriate link? Or am I missing an easier way?
Thanks a bunch in advance...
Re: first tapestry app
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 24, 2004, at 8:31 AM, Ebersole, Steve wrote:
> I am starting my first Tapestry application, meant as a POC for my
> bosses regarding use of Hibernate and the Spring Framework together
> with Tapestry as an approach for application building. But, of
> course, I quickly ran into a couple of questions regarding usage and
> best-practices (any ideas when the new user docs will be ready?).
Haha.... is that a volunteer to help write them?! :) Such a great
question - when will the docs be ready? When will 3.0 final be
released? We're in open source land, my friend!
> 1) Is there a recommended directory layout for the .page and .html
> files? Should the .page files be kept "inline" with the corresponding
> IPage impls within the package structure? Most of the example apps I
> have seen keep them bundled with the corresponding .html files, but
> that seems to break the seperation of concern to me, newb that I am.
We keep .page and .html together, in subdirectories under WEB-INF. We
spell out each page in .application. This is less than ideal, and I'm
hoping to effect a change in this area somehow in the 3.1 timeframe.
Classic Tapestry, look at the Workbench.... .html goes above WEB-INF
and .page goes under WEB-INF, and no need to specify <page> elements in
.application. This has some merit, but browsing to .html should not be
allowed in production, IMO.
> 2) In the .application file, does each page need to be explicitly
> listed using the <page/> element? It seems like you would need to
> if/when the .page files are not kept in the context root. But maybe
> even then you could reference the page via its context-path. I'm a
> little uncertain here.
You only need to list <page> when it is not found in the default search
path. This is documented somewhere, but I always refer to the code
myself.
The mechanism for where templates and specifications reside is
pluggable, though.
> 3) In trying to use the contrib:Table component, I'm kind of stuck.
> Based on the component docs, I am initially trying to use the
> source/columns definition approach but I keep getting complaints that
> the columns value I pass in cannot be parsed. What I have is:
> <component id="results" type="contrib:Table">
> <binding name="source" expression="userList" />
> <binding name="columns"
> expression="userName:UserName:userName,firstName:First
> Name:firstName,lastName:Last Name:lastName,email:Email:email" />
> </component>
> trying to use the id:description:expression column definition type.
> However, I keep getting OGNL parse exceptions as soon as it comes
> across the first ":".
Use a <static-binding> for columns instead. This is a fixed string,
not an OGNL expression for 'columns' in your example.
> 4) Still related to the Table component, whats the best way to element
> selection from a Table (i.e., say to go to a detail record for that
> row)? Should I manually build up the individual table-model
> components and include an impl of IRender for the
> ITableColumn.getValueRenderer() property which wraps the cell value in
> an appropriate link? Or am I missing an easier way?
In your scenario, define an @Block with the name "userNameColumnValue"
(the docs for contrib:Table do give more details on this) and in that
block you can create a hyperlink. This is the easiest way.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: first tapestry app
Posted by Petter Måhlén <pe...@chello.se>.
> 3) In trying to use the contrib:Table component, I'm kind of
> stuck. Based on the component docs, I am initially trying to
> use the source/columns definition approach but I keep getting
> complaints that the columns value I pass in cannot be parsed.
> What I have is:
> <component id="results" type="contrib:Table">
> <binding name="source" expression="userList" />
> <binding name="columns"
> expression="userName:UserName:userName,firstName:First
> Name:firstName,lastName:Last Name:lastName,email:Email:email" />
> </component>
> trying to use the id:description:expression column definition
> type. However, I keep getting OGNL parse exceptions as soon
> as it comes across the first ":".
I'm also a newbie, but I think you should use dots here. As in
"ognl:class.member".
/ Petter
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org