/[Apache-SVN]/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/LocaleListItemRenderer.java
ViewVC logotype

Contents of /tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/LocaleListItemRenderer.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 543957 - (show annotations)
Sun Jun 3 18:51:08 2007 UTC (2 years, 5 months ago) by jkuhnert
File MIME type: text/plain
File size: 1118 byte(s)
Resolves TAPESTRY-1531. 

-) Added prototype / scriptaculous javascript libraries to the framework core and updated appropriate license notices. 

-) Added new PrototypeResponseBuilder/contributor services for handling Prototype based XHR requests. 

-) Added a new @Suggest component which provides scriptaculous based auto completion of form text input (or textarea) input fields. 

-) Updated the documentation to cover the new componnet.

-) Added new example page to the TimeTracker demo covering usage of the component as well as an example of providing a custom ListItemRenderer to render a custom autocompleting html response.
1 package org.apache.tapestry.timetracker.page;
2
3 import org.apache.tapestry.IMarkupWriter;
4 import org.apache.tapestry.IRequestCycle;
5 import org.apache.tapestry.scriptaculous.ListItemRenderer;
6
7 import java.util.Iterator;
8 import java.util.Locale;
9
10 /**
11 * Sample implementation of a html suggest response.
12 */
13 public class LocaleListItemRenderer implements ListItemRenderer {
14
15 /**
16 * {@inheritDoc}
17 */
18 public void renderList(IMarkupWriter writer, IRequestCycle cycle, Iterator values)
19 {
20 if (cycle.isRewinding())
21 return;
22
23 //Write values out as simple strings
24 writer.begin("ul");
25
26 while (values.hasNext()) {
27
28 Locale value = (Locale)values.next();
29 if (value == null)
30 continue;
31
32 writer.begin("li");
33
34 writer.beginEmpty("img");
35 writer.attribute("src", "http://setiathome.free.fr/images/flags/" + value.getCountry().toLowerCase() + ".gif");
36 writer.print(value.getDisplayCountry());
37
38 writer.end("li");
39 }
40
41 writer.end();
42 }
43 }

Properties

Name Value
svn:eol-style native
svn:keywords Date Revision
svn:mime-type text/plain

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2