PropertySelection and IPropertySelectionModel in Apache Tapestry - So what have we done? (Page 5 of 5 )
To summarize, after we have created a model (an implementation of IPropertySelectionModel), working with drop-down lists in a Tapestry application becomes very simple. All we need to display the appropriate options is to provide the created model to a PropertySelection component through its model binding.
And in order to put the result of the user's selection into a page property or even straight into an ASO stored in the session, all we need to do is provide the familiar value binding. There is no code to write at all, even if the selection covers a very complicated object, perhaps retrieved from a database. All the code is written just once and encapsulated into the model; it then can be reused numerous times across multiple applications.
Writing an implementation of IPropertySelectionModel isn't a big deal either. We just need to remember which question each of its five methods answers and provide an appropriate answer.
What comes next?
My initial plan for the next issue was to start a new big topic, namely custom components development. However, I have suddenly realized that there is another Tapestry component which resembles PropertySelection; that one is named Autocompleter. It is also one of the AJAX-enabled components that come with Tapestry 4.1, and I know that many of you are waiting impatiently for something about AJAX.
So in the next article we are going to touch on the AJAX side of Tapestry and maybe, if space will allow, cover one of the minor outstanding topics that has accumulated over time. And then, in the article after the next, we'll unleash our creativity developing custom components.
Until the next article then.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |