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 77 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

In their opinion,
the annotations are for the case when you can't or don't want to use the naming
conventions. However, I managed to get used to the annotations, and I like them.
So, in the following chapters you will see a combination of both approaches.
Chapter 3
[ 61 ]
Let's run the application. Click on the Submit button, and you should see an output
in the console confirming that the event handler was invoked on submission:
Setting the message: hi there!
Handling form submission!
Next, we need to write some code to pass the message to the Another page.
First, we need to somehow obtain an instance of the Another page. The simplest
approach is to inject that page. That is, to simply tell Tapestry that we might need it,
like this:
@InjectPage
private Another another;
Now that we have an instance of the Another page, we can pass our message to
it easily:
another.setPassedMessage(message);
Finally, to tell Tapestry that we want it to show the Another page as a result of event
handling, we need to change the return type of the event handler method to Object
and return the used instance of the Another page from the method. Here is the code
for the Start page class with all the recent additions.


Pages:
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6