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

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

This is because the
persistent property, subscribe, was assigned the value true. This value is stored
into the session, and we have provided no way to revert it back to false. Of course,
you can invalidate the session by closing the browser window, but that wouldn't be a
natural thing to do.
To solve this problem, let's add another Checkbox component next to the TextField
used for email, like this:

t:value="email"/>
t:value="unsubscribe" onclick="this.form.submit()"/>
I don't want to subscribe

We also need to add another property, unsubscribe, to the Registration
page class:
private boolean unsubscribe;
public boolean isUnsubscribe()
{
return unsubscribe;
Simple Components
[ 116 ]
}
public void setUnsubscribe(boolean unsubscribe)
{
this.unsubscribe = unsubscribe;
}
When the user clicks on the new check box, the form will be submitted and the
unsubscribe property of the page class will become true. Now what we want
is to set the subscribe property to false whenever unsubscribe is set to true.
But, where do we implement this logic? The most natural place will be the form
submission handler.


Pages:
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6