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/07/11 08:32:05 UTC
svn commit: r962994 - in /click/trunk/click/examples:
src/org/apache/click/examples/page/ajax/table/ webapp/WEB-INF/ webapp/ajax/
webapp/ajax/compare/ webapp/ajax/content/ webapp/ajax/form/
webapp/ajax/table/
Author: sabob
Date: Sun Jul 11 06:32:04 2010
New Revision: 962994
URL: http://svn.apache.org/viewvc?rev=962994&view=rev
Log:
added missing licenses and more docs
Added:
click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxPage.java
- copied, changed from r962426, click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxDemoPage.java
click/trunk/click/examples/webapp/ajax/table/table-ajax.htm
- copied, changed from r962426, click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.htm
click/trunk/click/examples/webapp/ajax/table/table-ajax.js
- copied, changed from r962888, click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.js
Removed:
click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxDemoPage.java
click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.htm
click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.js
Modified:
click/trunk/click/examples/webapp/WEB-INF/menu.xml
click/trunk/click/examples/webapp/ajax/ajax-behavior.htm
click/trunk/click/examples/webapp/ajax/compare/javascript-ajax-demo.htm
click/trunk/click/examples/webapp/ajax/compare/jquery-ajax-demo.htm
click/trunk/click/examples/webapp/ajax/compare/prototype-ajax-demo.htm
click/trunk/click/examples/webapp/ajax/content/json-response.htm
click/trunk/click/examples/webapp/ajax/content/xml-response.htm
click/trunk/click/examples/webapp/ajax/form/advanced-form-ajax.htm
click/trunk/click/examples/webapp/ajax/form/simple-form-ajax.htm
click/trunk/click/examples/webapp/ajax/page-action.htm
Copied: click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxPage.java (from r962426, click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxDemoPage.java)
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxPage.java?p2=click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxPage.java&p1=click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxDemoPage.java&r1=962426&r2=962994&rev=962994&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxDemoPage.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/ajax/table/TableAjaxPage.java Sun Jul 11 06:32:04 2010
@@ -27,7 +27,7 @@ import org.apache.click.ajax.AjaxBehavio
import org.apache.click.control.ActionLink;
import org.apache.click.control.Column;
import org.apache.click.control.Table;
-import org.apache.click.dataprovider.DataProvider;
+import org.apache.click.dataprovider.PagingDataProvider;
import org.apache.click.element.Element;
import org.apache.click.element.JsImport;
import org.apache.click.element.JsScript;
@@ -38,10 +38,11 @@ import org.apache.click.extras.control.L
import org.springframework.stereotype.Component;
/**
- * Basic Table Ajax Demo example using the jQuery JavaScript library.
+ * Demonstrates how to sort, page, edit and delete customers using the
+ * Table control and jQuery.
*/
@Component
-public class TableAjaxDemoPage extends BorderPage {
+public class TableAjaxPage extends BorderPage {
private static final long serialVersionUID = 1L;
@@ -53,7 +54,7 @@ public class TableAjaxDemoPage extends B
@Resource(name="customerService")
private CustomerService customerService;
- public TableAjaxDemoPage() {
+ public TableAjaxPage() {
addControl(editLink);
editLink.addBehavior(new AjaxBehavior() {
@@ -121,9 +122,20 @@ public class TableAjaxDemoPage extends B
column.setDecorator(new LinkDecorator(table, links, "id"));
table.addColumn(column);
- table.setDataProvider(new DataProvider<Customer>() {
+ // Use a Paging DataProvider to only retrieve the selected customers
+ table.setDataProvider(new PagingDataProvider<Customer>() {
+
public List<Customer> getData() {
- return customerService.getCustomers();
+ int start = table.getFirstRow();
+ int count = table.getPageSize();
+ String sortColumn = table.getSortedColumn();
+ boolean ascending = table.isSortedAscending();
+
+ return customerService.getCustomersForPage(start, count, sortColumn, ascending);
+ }
+
+ public int size() {
+ return customerService.getNumberOfCustomers();
}
});
}
@@ -133,7 +145,7 @@ public class TableAjaxDemoPage extends B
if (headElements == null) {
headElements = super.getHeadElements();
headElements.add(new JsImport("/assets/js/jquery-1.4.2.js"));
- headElements.add(new JsScript("/ajax/table/table-ajax-demo.js", new HashMap()));
+ headElements.add(new JsScript("/ajax/table/table-ajax.js", new HashMap()));
}
return headElements;
}
Modified: click/trunk/click/examples/webapp/WEB-INF/menu.xml
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/WEB-INF/menu.xml?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/WEB-INF/menu.xml (original)
+++ click/trunk/click/examples/webapp/WEB-INF/menu.xml Sun Jul 11 06:32:04 2010
@@ -146,7 +146,7 @@
<menu label="jQuery AJAX Demo" path="ajax/compare/jquery-ajax-demo.htm"/>
<menu label="Prototype AJAX Demo" path="ajax/compare/prototype-ajax-demo.htm"/>
<menu separator="true"/>
- <menu label="Table AJAX Demo" path="ajax/table/table-ajax-demo.htm"/>
+ <menu label="Table AJAX Demo" path="ajax/table/table-ajax.htm"/>
<menu separator="true"/>
<menu label="Simple Form AJAX Demo" path="ajax/form/simple-form-ajax.htm"/>
<menu label="Advanced Form AJAX Demo" path="ajax/form/advanced-form-ajax.htm"/>
Modified: click/trunk/click/examples/webapp/ajax/ajax-behavior.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/ajax-behavior.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/ajax-behavior.htm (original)
+++ click/trunk/click/examples/webapp/ajax/ajax-behavior.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,32 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
+This example demonstrates how an <tt>AjaxBehavior</tt> can be used to handle and respond to an Ajax request.
+
+<p/>
+
+Click $link to call the server using Ajax.
+
+<div id="result">
+ <!-- Ajax response will be set here -->
+</div>
+
<script type="text/javascript" src="$context/assets/js/jquery-1.4.2.js"></script>
<script type="text/javascript">
@@ -31,14 +60,3 @@
});
}
</script>
-
-This example demonstrates how an AjaxBehavior can be used to handle and respond
-to an Ajax request.
-
-<p/>
-
-Click $link to call the server using Ajax.
-
-<div id="result">
- <!-- Ajax response will be set here -->
-</div>
\ No newline at end of file
Modified: click/trunk/click/examples/webapp/ajax/compare/javascript-ajax-demo.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/compare/javascript-ajax-demo.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/compare/javascript-ajax-demo.htm (original)
+++ click/trunk/click/examples/webapp/ajax/compare/javascript-ajax-demo.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,22 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
<p>
Demonstrates Click Ajax support using JavaScript. Compare this implementation
with the <a href="$context/ajax/compare/jquery-ajax-demo.htm">jQuery</a> and
Modified: click/trunk/click/examples/webapp/ajax/compare/jquery-ajax-demo.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/compare/jquery-ajax-demo.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/compare/jquery-ajax-demo.htm (original)
+++ click/trunk/click/examples/webapp/ajax/compare/jquery-ajax-demo.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,22 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
<p>
Demonstrates Click Ajax support using <a target="_blank" href="http://www.jquery.com/">jQuery</a>.
Compare this implementation with the <a href="$context/ajax/compare/javascript-ajax-demo.htm">Javascript</a> and
Modified: click/trunk/click/examples/webapp/ajax/compare/prototype-ajax-demo.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/compare/prototype-ajax-demo.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/compare/prototype-ajax-demo.htm (original)
+++ click/trunk/click/examples/webapp/ajax/compare/prototype-ajax-demo.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,22 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
<p>
Demonstrates Click Ajax support using <a target="_blank" href="http://www.prototypejs.org/">Prototype</a>.
Compare this implementation with the <a href="$context/ajax/compare/javascript-ajax-demo.htm">Javascript</a> and
Modified: click/trunk/click/examples/webapp/ajax/content/json-response.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/content/json-response.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/content/json-response.htm (original)
+++ click/trunk/click/examples/webapp/ajax/content/json-response.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,33 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
+This example shows how a Partial can return an <a href="http://www.json.org/" target="_blank" class="external">JSON</a> response.
+
+<p/>
+
+Click $link to call the server using Ajax.
+
+<div id="result">
+ <!-- Ajax response will be set here -->
+</div>
+
+
<script type="text/javascript" src="$context/assets/js/jquery-1.4.2.js"></script>
<script type="text/javascript">
@@ -26,14 +56,4 @@
jQuery("#result").html("<p class='infoMsg'>" + obj.msg + obj.date + "</p>");
}, {dataType:'json'});
}
-</script>
-
-This example shows how a Partial can return an <a href="http://www.json.org/" target="_blank">JSON</a> response.
-
-<p/>
-
-Click $link to call the server using Ajax.
-
-<div id="result">
- <!-- Ajax response will be set here -->
-</div>
\ No newline at end of file
+</script>
\ No newline at end of file
Modified: click/trunk/click/examples/webapp/ajax/content/xml-response.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/content/xml-response.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/content/xml-response.htm (original)
+++ click/trunk/click/examples/webapp/ajax/content/xml-response.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,33 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
+This example shows how a Partial can return an XML response.
+
+<p/>
+
+Click $link to call the server using Ajax.
+
+<div id="result">
+ <!-- Ajax response will be set here -->
+</div>
+
+
<script type="text/javascript" src="$context/assets/js/jquery-1.4.2.js"></script>
<script type="text/javascript">
@@ -28,14 +58,4 @@
jQuery("#result").html("<p class='infoMsg'>" + msg + date + "</p>");
}, {dataType:'xml'});
}
-</script>
-
-This example shows how a Partial can return an XML response.
-
-<p/>
-
-Click $link to call the server using Ajax.
-
-<div id="result">
- <!-- Ajax response will be set here -->
-</div>
\ No newline at end of file
+</script>
\ No newline at end of file
Modified: click/trunk/click/examples/webapp/ajax/form/advanced-form-ajax.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/form/advanced-form-ajax.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/form/advanced-form-ajax.htm (original)
+++ click/trunk/click/examples/webapp/ajax/form/advanced-form-ajax.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,31 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
+In this Ajax example the form <a href="http://api.jquery.com/jQuery.post/" target="_blank" class="external">POSTed</a>
+to the server and is then <a href="http://api.jquery.com/replaceWith/" target="_blank" class="external">replaced with</a>
+a new form returned from the server. This example shows advanced feature such as validation and integrating the DateField
+control. For more advanced Ajax Forms (eg. file uploads) have a look at the
+<a href="http://jquery.malsup.com/form/">jQuery Form Plugin</a>.
+<p/>
+See the <a href="$context/source-viewer.htm?filename=/ajax/form/advanced-form-ajax.js" target="_blank" class="external">advanced-form-ajax.js</a>
+script for details.
+
$form
<div id="feedback">
Modified: click/trunk/click/examples/webapp/ajax/form/simple-form-ajax.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/form/simple-form-ajax.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/form/simple-form-ajax.htm (original)
+++ click/trunk/click/examples/webapp/ajax/form/simple-form-ajax.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,30 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
+This example uses an Ajax <a href="http://api.jquery.com/jQuery.post/" target="_blank" class="external">POST</a>
+to submit the form data to the server using the jQuery
+<a href="http://api.jquery.com/serialize/" target="_blank" class="external">serialize</a>
+function.
+<p/>
+See the <a href="$context/source-viewer.htm?filename=/ajax/form/simple-form-ajax.js" target="_blank" class="external">simple-form-ajax.js</a>
+script for details.
+
$form
<div id="target">
Modified: click/trunk/click/examples/webapp/ajax/page-action.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/page-action.htm?rev=962994&r1=962993&r2=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/page-action.htm (original)
+++ click/trunk/click/examples/webapp/ajax/page-action.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,33 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+
+This example demonstrates how a <tt>PageAction</tt> can be used to handle and respond
+to an Ajax request.
+
+<p/>
+
+Click $link to call the server using Ajax.
+
+<div id="result">
+ <!-- Ajax response will be set here -->
+</div>
+
<script type="text/javascript" src="$context/assets/js/jquery-1.4.2.js"></script>
<script type="text/javascript">
@@ -32,14 +62,3 @@
});
}
</script>
-
-This example demonstrates how a PageAction can be used to handle and respond
-to an Ajax request.
-
-<p/>
-
-Click $link to call the server using Ajax.
-
-<div id="result">
- <!-- Ajax response will be set here -->
-</div>
Copied: click/trunk/click/examples/webapp/ajax/table/table-ajax.htm (from r962426, click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.htm)
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/table/table-ajax.htm?p2=click/trunk/click/examples/webapp/ajax/table/table-ajax.htm&p1=click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.htm&r1=962426&r2=962994&rev=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.htm (original)
+++ click/trunk/click/examples/webapp/ajax/table/table-ajax.htm Sun Jul 11 06:32:04 2010
@@ -1,3 +1,35 @@
+<!--
+#* Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.*#
+-->
+Demonstrates how to <a href="http://api.jquery.com/html/" class="external" target="_blank">update</a>
+a table through Ajax requests. This example uses an Ajax
+<a href="http://api.jquery.com/jQuery.get/" target="_blank" class="external">GET</a>
+request to <tt>sort</tt>, <tt>page</tt>, <tt>edit</tt> and <tt>delete</tt> customers.
+(The <tt>edit</tt> and <tt>delete</tt> functionality is not fully implemented though)
+<p/>
+See the <a href="$context/source-viewer.htm?filename=/ajax/table/table-ajax.js" target="_blank" class="external">table-ajax.js</a>
+script for details.
+
+<!--
+Note: the table is wrapped in a div, allowing us to easily replace both the table and its paginator
+from the server response
+-->
+
<div id="tableContainer">
$table
</div>
Copied: click/trunk/click/examples/webapp/ajax/table/table-ajax.js (from r962888, click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.js)
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/ajax/table/table-ajax.js?p2=click/trunk/click/examples/webapp/ajax/table/table-ajax.js&p1=click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.js&r1=962888&r2=962994&rev=962994&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/ajax/table/table-ajax-demo.js (original)
+++ click/trunk/click/examples/webapp/ajax/table/table-ajax.js Sun Jul 11 06:32:04 2010
@@ -31,7 +31,7 @@ jQuery(document).ready(function() {
if (callServer) {
// Make ajax request
- editCustomer(event);
+ editOrDeleteCustomer(event);
}
// Prevent the default browser behavior of navigating to the link
@@ -51,7 +51,7 @@ jQuery(document).ready(function() {
})
})
-function editCustomer(event) {
+function editOrDeleteCustomer(event) {
var link = jQuery(event.target);
var url = link.attr('href');
jQuery.get(url, function(data) {