Putting a YUI Face on a Java Web Application : Page 4
by Narayanan A.R.
Apr 30, 2009
Page 4 of 4
Be aware of the scope for callback methods. If the scope is incorrect, the this keyword will not reference the intended object. The YUI library event-handling classes have the ability to let you pass the object to which you set the scope. Go through the API documentation to see how this can be accomplished for a widget.
Use server-side includes to conditionally include screen parts. This improves the modularity of the application. The demo application renders the containers for all the entities. Instead, UI elements of other entities can be restricted from rendering based on a request parameter to the page. Alternatively, separate pages can be defined for each entity, and common HTML can be included as a file header and footer.
Be aware of how to revert a source file to a specific time using Local History in Eclipse. It's handy to know how to revert if things go wrong.
Take the Next Step
The next and final installment will cover the YUI DataTable in detail and demonstrate how to make AJAX server requests.
Narayanan A.R. is a passionate advocate of test-driven development, agile methodologies, Java technology, and design patterns. He has several years of experience in software design and development using Java technologies.