Updated Branches: refs/heads/5.4-js-rewrite b0d52d3b9 -> 65056e868
Test ability to include arbitrary partial-page-rendering content within an explicit JSONObject response Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/65056e86 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/65056e86 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/65056e86 Branch: refs/heads/5.4-js-rewrite Commit: 65056e8680f433791da46cc1e181427e74d2b5b0 Parents: 5687849 Author: Howard M. Lewis Ship <[email protected]> Authored: Mon Nov 19 16:42:04 2012 -0800 Committer: Howard M. Lewis Ship <[email protected]> Committed: Mon Nov 19 16:42:04 2012 -0800 ---------------------------------------------------------------------- .../integration/app1/pages/AutocompleteDemo.java | 16 +++++++++++++- 1 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/65056e86/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AutocompleteDemo.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AutocompleteDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AutocompleteDemo.java index 83bf9e4..3f67a41 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AutocompleteDemo.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AutocompleteDemo.java @@ -14,13 +14,13 @@ package org.apache.tapestry5.integration.app1.pages; +import org.apache.tapestry5.alerts.AlertManager; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.integration.app1.data.Track; import org.apache.tapestry5.integration.app1.services.MusicLibrary; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.ioc.internal.util.CollectionFactory; -import java.util.Collections; import java.util.List; public class AutocompleteDemo @@ -31,19 +31,31 @@ public class AutocompleteDemo @Persist private String title; + @Inject + private AlertManager alertManager; + List onProvideCompletionsFromTitle(String partialTitle) throws Exception { + boolean roundabout = false; + List<Track> matches = library.findByMatchingTitle(partialTitle); List<String> result = CollectionFactory.newList(); for (Track t : matches) + { result.add(t.getTitle()); - Collections.sort(result); + roundabout |= t.getTitle().equals("Roundabout"); + } // Thread.sleep(1000); + if (roundabout) + { + alertManager.info("Completions include 'Roundabout'."); + } + return result; }
