Prev | Current Page 142 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

form.submit()"/>
Check the box to subscribe to our Newsletter.




Chapter 4
[ 113 ]
Let's see how all this works together. First of all, this is yet another table row
(HTML element ) to be added to an already existing Registration page table,
just underneath the row with gender radio buttons. This row contains a Tapestry
component of the type If, as shown in the following code:

...

The only parameter of this test component provides a boolean value. Since
the default prefix for this parameter is prop, Tapestry will be looking for a
getSubscribe method in the page class. If this method returns true, the body of the
If component will be displayed. In our case, the body is represented by two table
cells displaying a TextField component and a label for it:


t:value="email"/>

Of course, for this to work, the Registration page should have a property
named email.
The If component has another, optional parameter named else. This parameter
should provide an alternative content to be displayed in case the test parameter
evaluates to false.


Pages:
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
śmieszne dowcipy bajka Connie Talbot dakolen dieta light