[image]  

 
       
Dev Shed
[image]   arrowDev Shed Discussion arrow Making a CelebrityCollector with Apach...

Making a CelebrityCollector with Apache Tapestry: the For Component

We are going to start a new project today, named CelebrityCollector. At first it will be very simple, but in the following articles we’ll be adding more and more functionality to it. Of course, the purpose at this stage of study is not to build a real-world application but to meet different Tapestry components and to learn various important concepts.

Read the Full Article Here

[ Comment on this topic ]  [ Add New Topic

  NBTapestry will be later   
  By: Alexander Kolesnikov (Plant Food)
at: 05-22-07 @ 8:49 am EST
 
 
In this issue we are beginning to build a new application, and I am going to use it to demonstrate quite a number of different Tapestry concepts and components.

If you remember, I was planning to demonstrate the use the NBTapestry module for NetBeans and these plans are not discarded but just delayed.

Alexander

 

  Re: Making a CelebrityCollector with Apache Tapestry: the For Component   
  By: Anonymous Loozah
at: 08-21-07 @ 10:29 am EST
 
 
<property name = "currentCelebrity"/>

<component id="eachCelebrity" type="For">
<binding name="source" value="celebrities"/>
<binding name="value" value="currentCelebrity" />
</component>

Can't really understand this, can you explain some more, particulary <property name="currentCelebrity"?
thanks

 

 
  Re: Making a CelebrityCollector with Apache Tapestry: the For Component   
  By: tashfeen (Plant Food)
at: 10-17-07 @ 4:28 pm EST
 
 
Please see Alexander's previous article for its explanation.
http://www.devshed.com/c/a/Apache/The-Properties-of-Tapestry-Pages/3/

 

 
  Re: Making a CelebrityCollector with Apache Tapestry: the For Component   
  By: Anonymous Loozah
at: 12-01-07 @ 3:44 am EST
 
 
<property name = "currentCelebrity"/>

The above is equivalent to creating a property currentCelebrity
in the .java class with getCurrentCelebrity() and set methods.

<component id="eachCelebrity" type="For">
<binding name="source" value="celebrities"/>
<binding name="value" value="currentCelebrity" />
</component>

So currentCelebrity is bound to the current Celebrity element inn
the list but is also a property and we can get it and use the
first and last name values from the Celebrity class.
Can't really understand this, can you explain some more, particulary <property name="currentCelebrity"?
thanks

 

  Re: Making a CelebrityCollector with Apache Tapestry: the For Component   
  By: tashfeen (Plant Food)
at: 10-17-07 @ 5:28 pm EST
 
 
public abstract class CelebritiesList extends BasePage {
public List getCelebrities() {
return new DataSource().getCelebrities();
}
}

the two parentehsis after DataSource should not be there right?

 

 
  Re: Making a CelebrityCollector with Apache Tapestry: the For Component   
  By: Alexander Kolesnikov (Plant Food)
at: 10-18-07 @ 5:28 pm EST
 
 
Why not? Count the brackets [image]

 

  Error help...   
  By: tashfeen (Plant Food)
at: 10-19-07 @ 10:57 pm EST
 
 
So, I get the error below. I was wondering if you could please also give some general strategies when debugging. For some reason, I have the hardest time figuring out bigs in tapestry. usually, i am pretty good at debuggin. maybe, becase i do not quite understand eerything. i dont know.

Here is the error i get once I try to compile:
"Tag <tr> on line 13 contains an invalid jwcid '”eachCelebrity”'."
"Could not parse template context:/WEB-INF/CelebrityList.html."

Here is the HTML:
<html>

</html>

And here is the page-specification:

<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
<page-specification class="com.devshed.tapestry.celebrities.CelebrityList">
<property name="currentCelebrity"/>
<component id="eachCelebrity" type="For">
<binding name="source" value="celebrities"/>
<binding name="value" value="currentCelebrity"/>
</component>
<component id="firstName" type="Insert">
<binding name="value" value="currentCelebrity.firstName"/>
</component>
<component id="lastName" type="Insert">
<binding name="value" value="currentCelebrity.lastName"/>
</component>
<component id="detailsLink" type="DirectLink">
<binding name="listener" value="listener[image]nShowDetails"/>
<binding name="parameters" value="currentCelebrity.id"/>
</component>
</page-specification>

 

 
  Re: Error help...   
  By: tashfeen (Plant Food)
at: 10-20-07 @ 11:25 am EST
 
 
Here is the HTML code that got left out from above:

<tr jwcid=”eachCelebrity”>
<td>
<a href="" jcwid="detailsLink"><span jwcid="lastName">Smith</span></a>
</td>
<td><span jwcid="firstName">John</span></td>
</tr>

 

 
  Re: Error help...   
  By: Anonymous Loozah
at: 11-06-07 @ 7:03 pm EST
 
 
Any takers?? Alex?

 

 
  Re: Error help...   
  By: Anonymous Loozah
at: 11-06-07 @ 8:43 pm EST
 
 
OK, so the porblem seems to be that I can not put a tapestry component in a table row HTML element. So, to fix it I just put a span elemanet around the tr element and it seems to work. Does this mean Tapestry does not support this or am I using an old version?

<span jwcid="eachCelebrity">
<tr>
<td><a href="" jwcid="detailsLink"><span jwcid="lastName">Smith</span></a> </td>
<td><span jwcid="firstName">John</span></td>
</tr>
</span>

 






© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics