editor t:id="biography"
t:value="celebrity.biography"
t:toolbarSet="Medium" t:width="350"
t:height="200"/>
My favorite toolbar set is the medium one. This is how it looks:
After the text of the biography is entered, formatted and submitted, what gets sent
to the server (and is stored in a property of the page class) is a piece of HTML with
all the markup that is needed to reproduce the formatting. We can later display the
biography on the details page, but right now we need to make sure that the new
information (and a new Celebrity object containing it) is stored properly in the
data source.
Advanced Components
[ 154 ]
All we need to do for this is to add the following fragment of code to the
AddCelebrity page:
@ApplicationState
private IDataSource dataSource;
Object onSubmitFromCelebrity()
{
dataSource.addCelebrity(celebrity);
return ShowAll.class;
}
We are handling form submission here, so our event handler
handles the submit event and is named appropriately, according to
convention. Looks all right, doesn't it? This will work for now, but
in the next chapter, we'll find out that in such a situation we should
handle the "success" event.
Pages:
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203