SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 177 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

The
Grid component will then invoke the methods of this interface and display the
information returned by them appropriately.
Next, we are going to see another advanced component, BeanEditForm. It is
somewhat similar to Grid in that it also can make use of BeanModel, and its
configuration is pretty similar too.
BeanEditForm Component
Our current collection of celebrities is tiny, and it would be a good idea to provide
in the application functionality for adding new celebrities. Let's begin by adding a
template and a page class for a new page named AddCelebrity. Add to the page
class a single persistent property named celebrity, so that its code looks like this:
package com.packtpub.celebrities.pages;
import com.packtpub.celebrities.model.Celebrity;
import org.apache.tapestry.annotations.Persist;
public class AddCelebrity
{
@Persist
private Celebrity celebrity;
public Celebrity getCelebrity()
{
return celebrity;
}
public void setCelebrity(Celebrity celebrity)
{
this.celebrity = celebrity;
}
}
Advanced Components
[ 140 ]
In the page template, declare one single component of type BeanEditForm and let its
id be the same as the name of the property of the page class, in our case, celebrity:
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6