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 2010/12/25 16:26:47 UTC

svn commit: r1052795 - in /click/trunk/click/examples: src/org/apache/click/examples/page/ajax/ src/org/apache/click/examples/page/ajax/select/ webapp/ajax/select/

Author: sabob
Date: Sat Dec 25 15:26:46 2010
New Revision: 1052795

URL: http://svn.apache.org/viewvc?rev=1052795&view=rev
Log:
Remove auto binding from examples CLK-742

Removed:
    click/trunk/click/examples/src/org/apache/click/examples/page/ajax/select/AjaxCustomer.java
    click/trunk/click/examples/webapp/ajax/select/ajax-customer.htm
Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/ajax/AutoCompletePage.java
    click/trunk/click/examples/src/org/apache/click/examples/page/ajax/select/AjaxSelect.java
    click/trunk/click/examples/webapp/ajax/select/ajax-select.htm

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/ajax/AutoCompletePage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/ajax/AutoCompletePage.java?rev=1052795&r1=1052794&r2=1052795&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/ajax/AutoCompletePage.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/ajax/AutoCompletePage.java Sat Dec 25 15:26:46 2010
@@ -27,7 +27,6 @@ import org.apache.click.control.Form;
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.service.PostCodeService;
 import org.apache.click.extras.control.AutoCompleteTextField;
-import org.apache.click.util.Bindable;
 import org.springframework.stereotype.Component;
 
 /**
@@ -38,7 +37,7 @@ public class AutoCompletePage extends Bo
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form();
+    private Form form = new Form("form");
 
     @Resource(name="postCodeService")
     private PostCodeService postCodeService;
@@ -46,6 +45,8 @@ public class AutoCompletePage extends Bo
     // ------------------------------------------------------------ Constructor
 
     public AutoCompletePage() {
+        addControl(form);
+
         FieldSet fieldSet = new FieldSet("Enter a Suburb Location");
         fieldSet.setStyle("background-color", "");
         form.add(fieldSet);

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/ajax/select/AjaxSelect.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/ajax/select/AjaxSelect.java?rev=1052795&r1=1052794&r2=1052795&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/ajax/select/AjaxSelect.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/ajax/select/AjaxSelect.java Sat Dec 25 15:26:46 2010
@@ -25,9 +25,7 @@ import java.util.Map;
 import javax.annotation.Resource;
 
 import org.apache.click.Context;
-import org.apache.click.Control;
 import org.apache.click.ActionResult;
-import org.apache.click.ajax.AjaxBehavior;
 import org.apache.click.control.Option;
 import org.apache.click.control.Select;
 import org.apache.click.dataprovider.DataProvider;
@@ -38,7 +36,6 @@ import org.apache.click.examples.control
 import org.apache.click.examples.domain.Customer;
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.service.CustomerService;
-import org.apache.click.util.Bindable;
 import org.apache.click.util.ClickUtils;
 import org.springframework.stereotype.Component;
 
@@ -50,11 +47,17 @@ public class AjaxSelect extends BorderPa
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Select customerSelect = new Select("customerSelect");
+    private Select customerSelect = new Select("customerSelect");
 
     @Resource(name="customerService")
     private CustomerService customerService;
 
+    // Constructors -----------------------------------------------------------
+
+    public AjaxSelect() {
+        addControl(customerSelect);
+    }
+
     // Event Handlers ---------------------------------------------------------
 
     // A pageAction that handles Ajax requests for a particular customer

Modified: click/trunk/click/examples/webapp/ajax/select/ajax-select.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/select/ajax-select.htm?rev=1052795&r1=1052794&r2=1052795&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/select/ajax-select.htm (original)
+++ click/trunk/click/examples/webapp/ajax/select/ajax-select.htm Sat Dec 25 15:26:46 2010
@@ -51,10 +51,8 @@ and a &lt;div id='<span class="st">custo
 </pre>
 
 <p/>
-When you click on the select, an HTTP request (e.g. <tt>GET ajax-customer.htm?customerId=4424</tt>)
-is made to the 
-<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/page/ajax/AjaxCustomer.java">AjaxCustomer</a>
-page to get the customers details. These details are returned as HTML with a content-type of 'text/html':
+When you click on the select, an HTTP request (e.g. <tt>GET ajax-select.htm?pageAction=onChangeCustomer&customerId=202</tt>)
+is made to the page to get the customers details. These details are returned as HTML with a content-type of 'text/html':
 <pre class="codeHtml">
 &lt;table border="0" cellspacing="2" cellpadding="2">
   &lt;tr>
@@ -101,9 +99,9 @@ target "<span class="red">customerDetail
 
         // Ajax.Updater requests the customer for the given customerId parameter
         // and replaces the inner HTML of customerDetails div
-        new <span class="maroon">Ajax.Updater</span>('<span class="red">customerDetails</span>', '<span class="blue">/click-examples/ajax/ajax-customer.htm</span>', {
-          <span class="green">method</span>: 'get',
-          <span class="green">parameters</span>: {customerId : select.value}
+        new <span class="maroon">Ajax.Updater</span>('<span class="red">customerDetails</span>', '<span class="blue">/click-examples/ajax/select/ajax-select.htm</span>', {
+          <span class="green">method</span>: <span class="blue">'get'</span>,
+          <span class="green">parameters</span>: {<span class="blue">'pageAction'</span> : 'onChangeCustomer', <span class="blue">'customerId'</span> : select.value}
         });
       });
     });
@@ -113,5 +111,5 @@ target "<span class="red">customerDetail
 </pre>
 
 The initialization code above is contained in the 
-<a href="$context/source-viewer.htm?filename=ajax/ajax-select.js">ajax-select.js</a>
+<a href="$context/source-viewer.htm?filename=ajax/select/ajax-select.js">ajax-select.js</a>
 template.