click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r953265 - in /click/trunk/click/examples: src/org/apache/click/examples/page/introduction/LinkListPage.java webapp/WEB-INF/menu.xml webapp/introduction/link-list.htm
Date Thu, 10 Jun 2010 09:44:08 GMT
Author: sabob
Date: Thu Jun 10 09:44:08 2010
New Revision: 953265

URL: http://svn.apache.org/viewvc?rev=953265&view=rev
Log:
added link list demo

Added:
    click/trunk/click/examples/src/org/apache/click/examples/page/introduction/LinkListPage.java
    click/trunk/click/examples/webapp/introduction/link-list.htm
Modified:
    click/trunk/click/examples/webapp/WEB-INF/menu.xml

Added: click/trunk/click/examples/src/org/apache/click/examples/page/introduction/LinkListPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/introduction/LinkListPage.java?rev=953265&view=auto
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/introduction/LinkListPage.java
(added)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/introduction/LinkListPage.java
Thu Jun 10 09:44:08 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+package org.apache.click.examples.page.introduction;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.click.ActionListener;
+import org.apache.click.Control;
+import org.apache.click.control.ActionLink;
+import org.apache.click.examples.page.BorderPage;
+
+/**
+ * Provides an example on adding a list of ActionLinks to a page.
+ */
+public class LinkListPage extends BorderPage {
+
+    private static final long serialVersionUID = 1L;
+
+    /* List of ActionLinks. */
+    private List links = new ArrayList();
+
+    /** An output message. */
+    private String msg;
+
+    public LinkListPage() {
+        for (int i = 0; i < 3; i++) {
+
+            ActionLink link = new ActionLink("link" + i);
+            link.setActionListener(new ActionListener() {
+
+                public boolean onAction(Control source) {
+                    msg = "ControlListenerListPage#" + source.getName()
+                        + " object method <tt>onLinkClick()</tt> invoked.";
+
+                    addModel("msg", msg);
+                    return true;
+                }
+            });
+
+            addControl(link);
+            links.add(link);
+        }
+
+        addModel("links", links);
+    }
+}

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=953265&r1=953264&r2=953265&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/WEB-INF/menu.xml (original)
+++ click/trunk/click/examples/webapp/WEB-INF/menu.xml Thu Jun 10 09:44:08 2010
@@ -40,6 +40,8 @@
     <menu separator="true"/>
     <menu label="Simple Form" path="introduction/simple-form.htm"/>
     <menu label="Advanced Form" path="introduction/advanced-form.htm"/>
+    <menu separator="true"/>
+    <menu label="Link List" path="introduction/link-list.htm"/>
   </menu>
 
   <menu label="General" path="#" imageSrc="/assets/images/general.png">

Added: click/trunk/click/examples/webapp/introduction/link-list.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/introduction/link-list.htm?rev=953265&view=auto
==============================================================================
--- click/trunk/click/examples/webapp/introduction/link-list.htm (added)
+++ click/trunk/click/examples/webapp/introduction/link-list.htm Thu Jun 10 09:44:08 2010
@@ -0,0 +1,28 @@
+<!--
+#* 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.*#
+-->
+
+<ul>
+#foreach($link in $links)
+  <li>$link</li>
+#end
+</ul>
+
+#if ($msg)
+  <p class="infoMsg"> $msg </p>
+#end
\ No newline at end of file



Mime
View raw message