01: package org.ztemplates.tutorial.yui.autocomplete.array;
02:
03: import org.ztemplates.render.ZExpose;
04: import org.ztemplates.render.ZRenderer;
05: import org.ztemplates.render.velocity.ZVelocityRenderer;
06: import org.ztemplates.yui.autocomplete.YAutocomplete;
07: import org.ztemplates.yui.datasource.YDataSource;
08: import org.ztemplates.yui.datasource.YDataSourceArray;
09:
10: @ZRenderer(value=ZVelocityRenderer.class,zscript=true)
11: public class AutocompleteViewArray {
12: private YAutocomplete autocomplete;
13:
14: public AutocompleteViewArray() {
15: String[] values = new String[] { "Alabama", "Alaska",
16: "Arizona", "Arkansas", "California", "Colorado",
17: "Connecticut", "Delaware", "Florida", "Georgia",
18: "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa",
19: "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland",
20: "Massachusetts", "Michigan", "Minnesota",
21: "Mississippi", "Missouri", "Montana", "Nebraska",
22: "Nevada", "New Hampshire", "New Jersey", "New Mexico",
23: "New York", "North Dakota", "North Carolina", "Ohio",
24: "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
25: "South Carolina", "South Dakota", "Tennessee", "Texas",
26: "Utah", "Vermont", "Virginia", "Washington",
27: "West Virginia", "Wisconsin", "Wyoming" };
28: YDataSource ds = new YDataSourceArray(values);
29: autocomplete = new YAutocomplete(ds);
30: }
31:
32: @ZExpose(render=true)
33: public YAutocomplete getAutocomplete() {
34: return autocomplete;
35: }
36:
37: @ZExpose
38: public String getInputId() {
39: return autocomplete.getInput().getValue();
40: }
41:
42: @ZExpose
43: public String getContainerId() {
44: return autocomplete.getContainer().getValue();
45: }
46: }
|