You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2009/06/08 23:09:05 UTC

svn commit: r782786 - /incubator/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java

Author: sabob
Date: Mon Jun  8 21:09:05 2009
New Revision: 782786

URL: http://svn.apache.org/viewvc?rev=782786&view=rev
Log:
updated ajax-select docs

Modified:
    incubator/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java

Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java?rev=782786&r1=782785&r2=782786&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java Mon Jun  8 21:09:05 2009
@@ -18,12 +18,12 @@
  */
 package org.apache.click.examples.page.pageflow;
 
-import java.util.HashMap;
 import java.util.List;
 
 import java.util.Map;
 import javax.annotation.Resource;
 
+import org.apache.click.Context;
 import org.apache.click.control.Form;
 import org.apache.click.control.Option;
 import org.apache.click.control.Select;
@@ -36,8 +36,10 @@
 import org.apache.click.examples.domain.Customer;
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.page.HomePage;
+import org.apache.click.examples.page.ajax.AjaxCustomer;
 import org.apache.click.examples.service.CustomerService;
 import org.apache.click.extras.control.DateField;
+import org.apache.click.util.ClickUtils;
 import org.springframework.stereotype.Component;
 
 /**
@@ -151,13 +153,15 @@
             // the web folder "/click/prototype/"
             headElements.add(new JsImport("/click/prototype/prototype.js"));
 
+            Context context = getContext();
+
             // Create a model to pass to the Page JavaScript template. The
-            // template recognizes three Velocity variables:
-            // $context, $selector and $target
-            Map model = new HashMap();
+            // template recognizes the following Velocity variables:
+            // $context, $path, $selector and $target
+            Map model = ClickUtils.createTemplateModel(this, context);
 
-            // Add the application context path -> "/click-examples"
-            model.put("context", getContext().getRequest().getContextPath());
+            // Set path to the AjaxCustomer Page path
+            model.put("path", context.getPagePath(AjaxCustomer.class));
 
             // Add a CSS selector, in this case the customerSelect ID attribute
             model.put("selector", customerSelect.getId());