You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by me...@apache.org on 2009/06/10 14:57:16 UTC
svn commit: r783339 [2/2] - in /incubator/click/trunk/click/examples:
src/org/apache/click/examples/control/ src/org/apache/click/examples/page/
src/org/apache/click/examples/page/ajax/
src/org/apache/click/examples/page/cayenne/ src/org/apache/click/e...
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java Wed Jun 10 12:57:14 2009
@@ -1,78 +1,81 @@
-/*
- * 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.jsp;
-
-import org.apache.click.control.FieldSet;
-import org.apache.click.control.Form;
-import org.apache.click.control.Submit;
-import org.apache.click.control.TextField;
-import org.apache.click.examples.page.BorderPage;
-import org.apache.click.extras.control.DateField;
-import org.apache.click.extras.control.DoubleField;
-import org.apache.click.extras.control.EmailField;
-
-/**
- * Demo a form submit using JSP as template.
- *
- * @author Bob Schellink
- */
-public class EditCustomerPage extends BorderPage {
-
- public Form form = new Form("form");
-
- public EditCustomerPage() {
- // Setup customers form
- FieldSet fieldSet = new FieldSet("customer");
- fieldSet.add(new TextField("name", true));
- fieldSet.add(new EmailField("email"));
- fieldSet.add(new DoubleField("holdings", true));
- fieldSet.add(new DateField("dateJoined"));
- form.add(fieldSet);
- form.add(new Submit("save", this, "onSaveClick"));
- form.add(new Submit("cancel", this, "onCancelClick"));
- }
-
- public boolean onSecurityCheck() {
- return form.onSubmitCheck(this, EditCustomerPage.class);
- }
-
- /**
- * Returns the name of the border template: <tt>"/border-template.jsp"</tt>
- *
- * @see org.apache.click.Page#getTemplate()
- */
- public String getTemplate() {
- return "/border-template.jsp";
- }
-
- public boolean onSaveClick() {
- if (form.isValid()) {
- // Perform logic
- // Optionally forward to another Page for display:
- // setForward(ViewCustomersPage.class);
- }
- return true;
- }
-
- public boolean onCancelClick() {
- form.clearErrors();
- form.clearValues();
- return true;
- }
-}
+/*
+ * 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.jsp;
+
+import org.apache.click.control.FieldSet;
+import org.apache.click.control.Form;
+import org.apache.click.control.Submit;
+import org.apache.click.control.TextField;
+import org.apache.click.examples.page.BorderPage;
+import org.apache.click.extras.control.DateField;
+import org.apache.click.extras.control.DoubleField;
+import org.apache.click.extras.control.EmailField;
+import org.apache.click.util.Bindable;
+
+/**
+ * Demo a form submit using JSP as template.
+ *
+ * @author Bob Schellink
+ */
+public class EditCustomerPage extends BorderPage {
+
+ @Bindable public Form form = new Form("form");
+
+ public EditCustomerPage() {
+ // Setup customers form
+ FieldSet fieldSet = new FieldSet("customer");
+ fieldSet.add(new TextField("name", true));
+ fieldSet.add(new EmailField("email"));
+ fieldSet.add(new DoubleField("holdings", true));
+ fieldSet.add(new DateField("dateJoined"));
+ form.add(fieldSet);
+ form.add(new Submit("save", this, "onSaveClick"));
+ form.add(new Submit("cancel", this, "onCancelClick"));
+ }
+
+ @Override
+ public boolean onSecurityCheck() {
+ return form.onSubmitCheck(this, EditCustomerPage.class);
+ }
+
+ /**
+ * Returns the name of the border template: <tt>"/border-template.jsp"</tt>
+ *
+ * @see org.apache.click.Page#getTemplate()
+ */
+ @Override
+ public String getTemplate() {
+ return "/border-template.jsp";
+ }
+
+ public boolean onSaveClick() {
+ if (form.isValid()) {
+ // Perform logic
+ // Optionally forward to another Page for display:
+ // setForward(ViewCustomersPage.class);
+ }
+ return true;
+ }
+
+ public boolean onCancelClick() {
+ form.clearErrors();
+ form.clearValues();
+ return true;
+ }
+}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java Wed Jun 10 12:57:14 2009
@@ -21,6 +21,7 @@
import java.util.Date;
import org.apache.click.Page;
+import org.apache.click.util.Bindable;
/**
* Provides HelloWorld world example Page. Possibly the simplest dynamic example
@@ -33,6 +34,6 @@
*/
public class HelloWorld extends Page {
- public Date time = new Date();
+ @Bindable public Date time = new Date();
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java Wed Jun 10 12:57:14 2009
@@ -21,6 +21,7 @@
import org.apache.click.control.ActionLink;
import org.apache.click.control.PageLink;
import org.apache.click.examples.page.BorderPage;
+import org.apache.click.util.Bindable;
/**
*
@@ -28,15 +29,16 @@
*/
public class MultiPathDemo extends BorderPage {
- public ActionLink changePath = new ActionLink("changePath", this, "changePath");
+ @Bindable public ActionLink changePath = new ActionLink("changePath", this, "changePath");
- public PageLink defaultPath = new PageLink("defaultPath", MultiPathDemo.class);
+ @Bindable public PageLink defaultPath = new PageLink("defaultPath", MultiPathDemo.class);
public boolean changePath() {
setPath("/jsp/dummy.jsp");
return true;
}
+ @Override
public String getTemplate() {
return "/border-template.jsp";
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java Wed Jun 10 12:57:14 2009
@@ -1,122 +1,116 @@
-/*
- * 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.jsp;
-
-import org.apache.click.control.ActionLink;
-import org.apache.click.examples.page.BorderPage;
-
-/**
- * Provides an navigation example Page demonstrating forward and redirect
- * page navigation.
- *
- * @author Malcolm Edgar
- */
-public class NavigationA extends BorderPage {
-
- public ActionLink forwardLink = new ActionLink("forwardLink", this, "onForwardClick");
- public ActionLink forwardParamLink = new ActionLink("forwardParamLink", this, "onForwardParamClick");
- public ActionLink redirectLink = new ActionLink("redirectLink", this, "onRedirectClick");
- public ActionLink redirectParamLink = new ActionLink("redirectParamLink", this, "onRedirectParamClick");
-
- // --------------------------------------------------------- Event Handlers
-
- /**
- * @see org.apache.click.Page#onInit()
- */
- public void onInit() {
- super.onInit();
-
- // Initialise param ActionLink values from any parameters passed through
- // from other pages via forwards or redirects.
- Integer number = new Integer(1);
-
- // If request has been forwarded
- if (getContext().isForward()) {
- // If a request attribute was passed increment its value.
- Integer param = (Integer) getContext().getRequestAttribute("param");
- if (param != null) {
- number = new Integer(param.intValue() + 1);
- }
-
- // Else request may have been redirected
- } else {
- String param = getContext().getRequest().getParameter("param");
- if (param != null) {
- number = new Integer(Integer.parseInt(param) + 1);
- }
- }
-
- forwardParamLink.setValue(number.toString());
- redirectParamLink.setValue(number.toString());
- }
-
- public boolean onForwardClick() {
- setForward(getTarget());
- return false;
- }
-
- public boolean onForwardParamClick() {
- Integer param = forwardParamLink.getValueInteger();
- getContext().setRequestAttribute("param", param);
- setForward(getTarget());
- return false;
- }
-
- public boolean onRedirectClick() {
- setRedirect(getTarget());
- return false;
- }
-
- public boolean onRedirectParamClick() {
- setRedirect(getTarget() + "?param=" + redirectParamLink.getValue());
- return false;
- }
-
- // --------------------------------------------------------- Public Methods
-
- /**
- * Target template to forward to.
- * <p/>
- * In order to forward to a Page with a JSP template, we specify the target
- * with an htm extension so that ClickServlet will process the Page.
- * After the Page NavigationB.java is processed, Click will forward to the
- * underlying template /jsp/navigation-b.jsp.
- */
- public String getTarget() {
- return "/jsp/navigation-b.htm";
- }
-
- /**
- * Note one can also forward and redirect using the Page class instead of
- * the path as seen below.
- */
- /*
- public Class getTargetPageClass() {
- return NavigationB.class;
- }*/
-
- /**
- * Returns the name of the border template: <tt>"/border-template.jsp"</tt>
- *
- * @see org.apache.click.Page#getTemplate()
- */
- public String getTemplate() {
- return "/border-template.jsp";
- }
-}
+/*
+ * 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.jsp;
+
+import org.apache.click.control.ActionLink;
+import org.apache.click.examples.page.BorderPage;
+import org.apache.click.util.Bindable;
+
+/**
+ * Provides an navigation example Page demonstrating forward and redirect
+ * page navigation.
+ *
+ * @author Malcolm Edgar
+ */
+public class NavigationA extends BorderPage {
+
+ @Bindable public ActionLink forwardLink = new ActionLink("forwardLink", this, "onForwardClick");
+ @Bindable public ActionLink forwardParamLink = new ActionLink("forwardParamLink", this, "onForwardParamClick");
+ @Bindable public ActionLink redirectLink = new ActionLink("redirectLink", this, "onRedirectClick");
+ @Bindable public ActionLink redirectParamLink = new ActionLink("redirectParamLink", this, "onRedirectParamClick");
+
+ // --------------------------------------------------------- Event Handlers
+
+ /**
+ * @see org.apache.click.Page#onInit()
+ */
+ @Override
+ public void onInit() {
+ super.onInit();
+
+ // Initialise param ActionLink values from any parameters passed through
+ // from other pages via forwards or redirects.
+ Integer number = new Integer(1);
+
+ // If request has been forwarded
+ if (getContext().isForward()) {
+ // If a request attribute was passed increment its value.
+ Integer param = (Integer) getContext().getRequestAttribute("param");
+ if (param != null) {
+ number = new Integer(param.intValue() + 1);
+ }
+
+ // Else request may have been redirected
+ } else {
+ String param = getContext().getRequest().getParameter("param");
+ if (param != null) {
+ number = new Integer(Integer.parseInt(param) + 1);
+ }
+ }
+
+ forwardParamLink.setValue(number.toString());
+ redirectParamLink.setValue(number.toString());
+ }
+
+ public boolean onForwardClick() {
+ setForward(getTarget());
+ return false;
+ }
+
+ public boolean onForwardParamClick() {
+ Integer param = forwardParamLink.getValueInteger();
+ getContext().setRequestAttribute("param", param);
+ setForward(getTarget());
+ return false;
+ }
+
+ public boolean onRedirectClick() {
+ setRedirect(getTarget());
+ return false;
+ }
+
+ public boolean onRedirectParamClick() {
+ setRedirect(getTarget() + "?param=" + redirectParamLink.getValue());
+ return false;
+ }
+
+ // --------------------------------------------------------- Public Methods
+
+ /**
+ * Target template to forward to.
+ * <p/>
+ * In order to forward to a Page with a JSP template, we specify the target
+ * with an htm extension so that ClickServlet will process the Page.
+ * After the Page NavigationB.java is processed, Click will forward to the
+ * underlying template /jsp/navigation-b.jsp.
+ */
+ public String getTarget() {
+ return "/jsp/navigation-b.htm";
+ }
+
+ /**
+ * Returns the name of the border template: <tt>"/border-template.jsp"</tt>
+ *
+ * @see org.apache.click.Page#getTemplate()
+ */
+ @Override
+ public String getTemplate() {
+ return "/border-template.jsp";
+ }
+}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationB.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationB.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationB.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationB.java Wed Jun 10 12:57:14 2009
@@ -1,58 +1,52 @@
-/*
- * 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.jsp;
-
-/**
- * Provides an navigation example Page demonstrating forward and redirect
- * page navigation. See NavigationA page for details.
- *
- * @author Malcolm Edgar
- */
-public class NavigationB extends NavigationA {
-
- /**
- * Target template to forward to.
- * <p/>
- * In order to forward to a Page with a JSP template, we specify the target
- * with an htm extension so that ClickServlet will process the Page.
- * After the Page NavigationA.java is processed, Click will forward to the
- * underlying template /jsp/navigation-a.jsp.
- */
- public String getTarget() {
- return "/jsp/navigation-a.htm";
- }
-
- /**
- * Note one can also forward and redirect using the Page class instead of
- * the path as seen below.
- */
- /*
- public Class getTargetPageClass() {
- return NavigationA.class;
- }*/
-
- /**
- * Returns the name of the border template: <tt>"/border-template.jsp"</tt>
- *
- * @see org.apache.click.Page#getTemplate()
- */
- public String getTemplate() {
- return "/border-template.jsp";
- }
-}
+/*
+ * 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.jsp;
+
+/**
+ * Provides an navigation example Page demonstrating forward and redirect
+ * page navigation. See NavigationA page for details.
+ *
+ * @author Malcolm Edgar
+ */
+public class NavigationB extends NavigationA {
+
+ /**
+ * Target template to forward to.
+ * <p/>
+ * In order to forward to a Page with a JSP template, we specify the target
+ * with an htm extension so that ClickServlet will process the Page.
+ * After the Page NavigationA.java is processed, Click will forward to the
+ * underlying template /jsp/navigation-a.jsp.
+ */
+ @Override
+ public String getTarget() {
+ return "/jsp/navigation-a.htm";
+ }
+
+ /**
+ * Returns the name of the border template: <tt>"/border-template.jsp"</tt>
+ *
+ * @see org.apache.click.Page#getTemplate()
+ */
+ @Override
+ public String getTemplate() {
+ return "/border-template.jsp";
+ }
+
+}
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=783339&r1=783338&r2=783339&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 Wed Jun 10 12:57:14 2009
@@ -39,6 +39,7 @@
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.Bindable;
import org.apache.click.util.ClickUtils;
import org.springframework.stereotype.Component;
@@ -50,7 +51,8 @@
@Component
public class StartPage extends BorderPage {
- public Form form = new Form();
+ @Bindable public Form form = new Form();
+
private Select customerSelect;
private DateField dateField;
private Select courseSelect;
@@ -91,6 +93,7 @@
/**
* @see org.apache.click.Page#onSecurityCheck()
*/
+ @Override
public boolean onSecurityCheck() {
return form.onSubmitCheck(this, "/pageflow/invalid-submit.html");
}
@@ -145,6 +148,7 @@
*
* @see org.apache.click.Page#getHeadElements()
*/
+ @Override
public List getHeadElements() {
if (headElements == null) {
headElements = super.getHeadElements();
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java Wed Jun 10 12:57:14 2009
@@ -29,6 +29,7 @@
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.springframework.stereotype.Component;
/**
@@ -39,8 +40,8 @@
@Component
public class FilterPanelDemo extends BorderPage {
- public FilterPanel filterPanel = new FilterPanel();
- public Table table = new Table();
+ @Bindable public FilterPanel filterPanel = new FilterPanel();
+ @Bindable public Table table = new Table();
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java Wed Jun 10 12:57:14 2009
@@ -26,6 +26,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.service.CustomerService;
import org.apache.click.extras.panel.ListPanel;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -39,8 +40,8 @@
@Component
public class ListPanelDemo extends BorderPage {
- public ListPanel listPanel = new ListPanel();
- public List customers;
+ @Bindable public ListPanel listPanel = new ListPanel();
+ @Bindable public List customers;
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java Wed Jun 10 12:57:14 2009
@@ -30,6 +30,7 @@
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.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
@@ -41,10 +42,10 @@
@Component
public class PanelColumnDemo extends BorderPage {
- public Panel panel = new Panel("panel", "/panel/customerDetailsPanel.htm");
- public Form form = new Form();
- public String nameSearch;
- public Table table = new Table("table");
+ @Bindable public Panel panel = new Panel("panel", "/panel/customerDetailsPanel.htm");
+ @Bindable public Form form = new Form();
+ @Bindable public String nameSearch;
+ @Bindable public Table table = new Table("table");
private TextField textName = new TextField("name", true);
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ReusablePanelDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ReusablePanelDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ReusablePanelDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ReusablePanelDemo.java Wed Jun 10 12:57:14 2009
@@ -1,41 +1,43 @@
-/*
- * 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.panel;
-
-import org.apache.click.examples.control.ClientPanel;
-import org.apache.click.examples.page.BorderPage;
-
-/**
- * Provides example usage of a reusable ClientPanel, which contains a Form for
- * capturing Client details.
- *
- * @author Bob Schellink
- */
-public class ReusablePanelDemo extends BorderPage {
-
- private ClientPanel clientPanel = new ClientPanel("panel");
-
- public void onInit() {
- // Invoke super onInit implementation
- super.onInit();
-
- // Add customer panel to Page
- addControl(clientPanel);
- }
-}
+/*
+ * 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.panel;
+
+import org.apache.click.examples.control.ClientPanel;
+import org.apache.click.examples.page.BorderPage;
+
+/**
+ * Provides example usage of a reusable ClientPanel, which contains a Form for
+ * capturing Client details.
+ *
+ * @author Bob Schellink
+ */
+public class ReusablePanelDemo extends BorderPage {
+
+ private ClientPanel clientPanel = new ClientPanel("panel");
+
+ @Override
+ public void onInit() {
+ // Invoke super onInit implementation
+ super.onInit();
+
+ // Add customer panel to Page
+ addControl(clientPanel);
+ }
+
+}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java Wed Jun 10 12:57:14 2009
@@ -20,6 +20,7 @@
import org.apache.click.control.Panel;
import org.apache.click.examples.page.BorderPage;
+import org.apache.click.util.Bindable;
/**
* Provides a simple Panel demonstration.
@@ -28,6 +29,6 @@
*/
public class SimplePanelDemo extends BorderPage {
- public Panel panel = new Panel("panel", "/panel/simple-panel.htm");
+ @Bindable public Panel panel = new Panel("panel", "/panel/simple-panel.htm");
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/TabbedPanelDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/TabbedPanelDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/TabbedPanelDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/panel/TabbedPanelDemo.java Wed Jun 10 12:57:14 2009
@@ -26,6 +26,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.service.CustomerService;
import org.apache.click.extras.panel.TabbedPanel;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -36,8 +37,8 @@
@Component
public class TabbedPanelDemo extends BorderPage {
- public TabbedPanel tabbedPanel = new TabbedPanel();
- public List customers;
+ @Bindable public TabbedPanel tabbedPanel = new TabbedPanel();
+ @Bindable public List customers;
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/quartz/QuartzJobSchedulerPage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/quartz/QuartzJobSchedulerPage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/quartz/QuartzJobSchedulerPage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/quartz/QuartzJobSchedulerPage.java Wed Jun 10 12:57:14 2009
@@ -36,6 +36,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.quartz.JobAndSimpleTrigger;
import org.apache.click.examples.quartz.SchedulerService;
+import org.apache.click.util.Bindable;
import org.apache.click.util.HtmlStringBuffer;
import org.quartz.Trigger;
import org.quartz.ee.servlet.QuartzInitializerListener;
@@ -51,7 +52,7 @@
private static final String DATE_FORMAT = "{0,date,hh:mm a d MMM yy }";
/** The auto bound refresh button. */
- public ActionButton refresh = new ActionButton("refresh");
+ @Bindable public ActionButton refresh = new ActionButton("refresh");
// Private Variables ------------------------------------------------------
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Login.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Login.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Login.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Login.java Wed Jun 10 12:57:14 2009
@@ -30,6 +30,7 @@
import org.apache.click.examples.page.HomePage;
import org.apache.click.examples.service.UserService;
import org.apache.click.extras.control.PageSubmit;
+import org.apache.click.util.Bindable;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
@@ -41,8 +42,8 @@
@Component
public class Login extends BorderPage {
- public Form form = new Form();
- public HiddenField redirectField = new HiddenField("redirect", String.class);
+ @Bindable public Form form = new Form();
+ @Bindable public HiddenField redirectField = new HiddenField("redirect", String.class);
private TextField usernameField = new TextField("username", true);
private PasswordField passwordField = new PasswordField("password", true);
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Logout.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Logout.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Logout.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Logout.java Wed Jun 10 12:57:14 2009
@@ -21,6 +21,7 @@
import org.apache.click.Page;
import org.apache.click.examples.domain.User;
import org.apache.click.examples.page.BorderPage;
+import org.apache.click.util.Bindable;
/**
* Provides an user session logout Page.
@@ -29,11 +30,12 @@
*/
public class Logout extends BorderPage {
- public User user;
+ @Bindable public User user;
/**
* @see Page#onInit()
*/
+ @Override
public void onInit() {
super.onInit();
@@ -42,4 +44,5 @@
getContext().removeSessionAttribute("user");
}
}
+
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Secure.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Secure.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Secure.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/security/Secure.java Wed Jun 10 12:57:14 2009
@@ -32,6 +32,7 @@
/**
* @see Page#onSecurityCheck()
*/
+ @Override
public boolean onSecurityCheck() {
if (getContext().hasSessionAttribute("user")) {
return true;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java Wed Jun 10 12:57:14 2009
@@ -176,6 +176,7 @@
// --------------------------------------------------------- Event Handlers
+ @Override
public boolean onSecurityCheck() {
String pagePath = getContext().getPagePath(getClass());
@@ -191,6 +192,7 @@
/**
* @see org.apache.click.Page#onInit()
*/
+ @Override
public void onInit() {
super.onInit();
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java Wed Jun 10 12:57:14 2009
@@ -22,7 +22,7 @@
import javax.annotation.Resource;
-import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.BaseContext;
import org.apache.click.control.ActionLink;
import org.apache.click.control.Column;
import org.apache.click.control.FieldSet;
@@ -38,6 +38,7 @@
import org.apache.click.extras.control.DoubleField;
import org.apache.click.extras.control.EmailField;
import org.apache.click.extras.control.LinkDecorator;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -49,10 +50,10 @@
@Component
public class EditTable extends BorderPage {
- public CayenneForm form = new CayenneForm("form", Customer.class);
- public Table table = new Table();
- public ActionLink editLink = new ActionLink("edit", "Edit", this, "onEditClick");
- public ActionLink deleteLink = new ActionLink("delete", "Delete", this, "onDeleteClick");
+ @Bindable public CayenneForm form = new CayenneForm("form", Customer.class);
+ @Bindable public Table table = new Table();
+ @Bindable public ActionLink editLink = new ActionLink("edit", "Edit", this, "onEditClick");
+ @Bindable public ActionLink deleteLink = new ActionLink("delete", "Delete", this, "onDeleteClick");
@Resource(name="customerService")
private CustomerService customerService;
@@ -128,14 +129,14 @@
// Please note with Cayenne ORM this will persist any changes
// to data objects submitted by the form.
form.getDataObject();
- DataContext.getThreadDataContext().commitChanges();
+ BaseContext.getThreadObjectContext().commitChanges();
form.setDataObject(null);
}
return true;
}
public boolean onCancelClick() {
- DataContext.getThreadDataContext().rollbackChanges();
+ BaseContext.getThreadObjectContext().rollbackChanges();
form.setDataObject(null);
form.clearErrors();
return true;
@@ -144,6 +145,7 @@
/**
* @see org.apache.click.Page#onGet()
*/
+ @Override
public void onGet() {
form.getField(Table.PAGE).setValue("" + table.getPageNumber());
form.getField(Table.COLUMN).setValue(table.getSortedColumn());
@@ -152,6 +154,7 @@
/**
* @see org.apache.click.Page#onPost()
*/
+ @Override
public void onPost() {
String pageNumber = form.getField(Table.PAGE).getValue();
table.setPageNumber(Integer.parseInt(pageNumber));
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java Wed Jun 10 12:57:14 2009
@@ -37,6 +37,7 @@
import org.apache.click.extras.control.FormTable;
import org.apache.click.extras.control.NumberField;
import org.apache.click.extras.control.DateField;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -49,7 +50,7 @@
private static final int NUM_ROWS = 20;
- public FormTable table = new FormTable();
+ @Bindable public FormTable table = new FormTable();
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java Wed Jun 10 12:57:14 2009
@@ -28,6 +28,7 @@
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.springframework.stereotype.Component;
/**
@@ -39,7 +40,7 @@
@Component
public class LargeDatasetDemo extends BorderPage {
- public Table table;
+ @Bindable public Table table;
@Resource(name="customerService")
private CustomerService customerService;
@@ -76,6 +77,7 @@
/**
* @see org.apache.click.Page#onRender()
*/
+ @Override
public void onRender() {
// Create DataProvider for the specified table and total number of customers
DataProvider dataProvider = new DataProvider(table, getCustomerCount());
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java Wed Jun 10 12:57:14 2009
@@ -38,6 +38,8 @@
import org.apache.click.examples.service.CustomerService;
import org.apache.click.extras.control.DateField;
import org.apache.click.extras.control.LinkDecorator;
+import org.apache.click.extras.control.TableInlinePaginator;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -50,10 +52,10 @@
private static final long serialVersionUID = 1L;
- public Form form = new Form();
- public Table table = new Table();
- public PageLink editLink = new PageLink("Edit", EditCustomer.class);
- public ActionLink deleteLink = new ActionLink("Delete", this, "onDeleteClick");
+ @Bindable public Form form = new Form();
+ @Bindable public Table table = new Table();
+ @Bindable public PageLink editLink = new PageLink("Edit", EditCustomer.class);
+ @Bindable public ActionLink deleteLink = new ActionLink("Delete", this, "onDeleteClick");
private TextField nameField = new TextField(Customer.NAME_PROPERTY);
private DateField dateField = new DateField(Customer.DATE_JOINED_PROPERTY, "Start Date");
@@ -80,6 +82,8 @@
table.setPageSize(10);
table.setShowBanner(true);
table.setSortable(true);
+ table.setPaginator(new TableInlinePaginator(table));
+ table.setPaginatorAttachment(Table.PAGINATOR_INLINE);
Column column = new Column(Customer.NAME_PROPERTY);
column.setWidth("140px;");
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java Wed Jun 10 12:57:14 2009
@@ -32,6 +32,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.page.EditCustomer;
import org.apache.click.examples.service.CustomerService;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -42,12 +43,12 @@
@Component
public class TableDecorator extends BorderPage {
- public Table table = new Table();
- public Customer customerDetail;
+ @Bindable public Table table = new Table();
+ @Bindable public Customer customerDetail;
- public ActionLink viewLink = new ActionLink("view", this, "onViewClick");
- public PageLink editLink = new PageLink("edit", EditCustomer.class);
- public ActionLink deleteLink = new ActionLink("delete", this, "onDeleteClick");
+ @Bindable public ActionLink viewLink = new ActionLink("view", this, "onViewClick");
+ @Bindable public PageLink editLink = new PageLink("edit", EditCustomer.class);
+ @Bindable public ActionLink deleteLink = new ActionLink("delete", this, "onDeleteClick");
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableFooter.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableFooter.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableFooter.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableFooter.java Wed Jun 10 12:57:14 2009
@@ -28,6 +28,7 @@
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.HtmlStringBuffer;
import org.springframework.stereotype.Component;
@@ -39,7 +40,7 @@
@Component
public class TableFooter extends BorderPage {
- public Table table;
+ @Bindable public Table table;
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaginatorPage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaginatorPage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaginatorPage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaginatorPage.java Wed Jun 10 12:57:14 2009
@@ -29,6 +29,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.service.CustomerService;
import org.apache.click.extras.control.TableInlinePaginator;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -39,9 +40,9 @@
@Component
public class TablePaginatorPage extends BorderPage {
- public Table table1 = new Table();
- public Table table2 = new Table();
- public Table table3 = new Table();
+ @Bindable public Table table1 = new Table();
+ @Bindable public Table table2 = new Table();
+ @Bindable public Table table3 = new Table();
@Resource(name="customerService")
private CustomerService customerService;
@@ -66,6 +67,7 @@
/**
* @see org.apache.click.Page#onRender()
*/
+ @Override
public void onRender() {
List<Customer> customers = customerService.getCustomers();
table1.setRowList(customers);
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaging.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaging.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaging.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TablePaging.java Wed Jun 10 12:57:14 2009
@@ -27,6 +27,7 @@
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.springframework.stereotype.Component;
/**
@@ -37,7 +38,7 @@
@Component
public class TablePaging extends BorderPage {
- public Table table = new Table();
+ @Bindable public Table table = new Table();
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java Wed Jun 10 12:57:14 2009
@@ -27,6 +27,7 @@
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.springframework.stereotype.Component;
/**
@@ -37,7 +38,7 @@
@Component
public class TableSorting extends BorderPage {
- public Table table = new Table();
+ @Bindable public Table table = new Table();
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableStyles.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableStyles.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableStyles.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableStyles.java Wed Jun 10 12:57:14 2009
@@ -32,6 +32,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.service.CustomerService;
import org.apache.click.extras.control.TableInlinePaginator;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -42,8 +43,8 @@
@Component
public class TableStyles extends BorderPage {
- public Form form = new Form();
- public Table table = new Table();
+ @Bindable public Form form = new Form();
+ @Bindable public Table table = new Table();
private Select styleSelect = new Select("style", "Table Style:");
private Checkbox hoverCheckbox = new Checkbox("hover", "Hover Rows:");
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/AdvancedTreePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/AdvancedTreePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/AdvancedTreePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/AdvancedTreePage.java Wed Jun 10 12:57:14 2009
@@ -28,6 +28,7 @@
import org.apache.click.control.Form;
import org.apache.click.control.Submit;
import org.apache.click.examples.page.BorderPage;
+import org.apache.click.examples.util.ExampleUtils;
import org.apache.click.extras.tree.Tree;
import org.apache.click.extras.tree.TreeListener;
import org.apache.click.extras.tree.TreeNode;
@@ -48,6 +49,7 @@
/**
* @see org.apache.click.Page#onInit()
*/
+ @Override
public void onInit() {
super.onInit();
@@ -80,7 +82,7 @@
TreeOptions options = new TreeOptions();
options.javascriptEnabled = jsEnabled.isChecked();
options.rootNodeDisplayed = rootNodeDisplayed.isChecked();
- setSessionObject(options);
+ ExampleUtils.setSessionObject(options);
//Apply users new options
applyOptions();
@@ -308,7 +310,9 @@
private void applyOptions() {
//We retrieve our stored options from the session and set the controls state
- TreeOptions options = (TreeOptions) getSessionObject(TreeOptions.class);
+ TreeOptions options = (TreeOptions)
+ ExampleUtils.getSessionObject(TreeOptions.class);
+
jsEnabled.setChecked(options.javascriptEnabled);
rootNodeDisplayed.setChecked(options.rootNodeDisplayed);
@@ -331,4 +335,5 @@
//Enable notification to any tree listeners again
tree.setNotifyListeners(true);
}
+
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/CheckboxTreePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/CheckboxTreePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/CheckboxTreePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/CheckboxTreePage.java Wed Jun 10 12:57:14 2009
@@ -29,6 +29,7 @@
import org.apache.click.control.Reset;
import org.apache.click.control.Submit;
import org.apache.click.examples.page.BorderPage;
+import org.apache.click.examples.util.ExampleUtils;
import org.apache.click.extras.tree.CheckboxTree;
import org.apache.click.extras.tree.Tree;
import org.apache.click.extras.tree.TreeListener;
@@ -53,6 +54,7 @@
/**
* @see org.apache.click.Page#onInit()
*/
+ @Override
public void onInit() {
super.onInit();
@@ -233,7 +235,7 @@
options.javascriptEnabled = jsEnabled.isChecked();
options.rootNodeDisplayed = rootNodeDisplayed.isChecked();
options.selectChildNodes = selectChildNodes.isChecked();
- setSessionObject(options);
+ ExampleUtils.setSessionObject(options);
//Apply users new options
applyOptions();
@@ -327,7 +329,9 @@
private void applyOptions() {
//We retrieve our stored options from the session and set the controls state
- CheckboxTreeOptions options = (CheckboxTreeOptions) getSessionObject(CheckboxTreeOptions.class);
+ CheckboxTreeOptions options = (CheckboxTreeOptions)
+ ExampleUtils.getSessionObject(CheckboxTreeOptions.class);
+
jsEnabled.setChecked(options.javascriptEnabled);
rootNodeDisplayed.setChecked(options.rootNodeDisplayed);
selectChildNodes.setChecked(options.selectChildNodes);
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PageLinkTreePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PageLinkTreePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PageLinkTreePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PageLinkTreePage.java Wed Jun 10 12:57:14 2009
@@ -115,4 +115,5 @@
protected String getSessionKey() {
return TREE_NODES_SESSION_KEY;
}
+
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PlainTreePage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PlainTreePage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PlainTreePage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/tree/PlainTreePage.java Wed Jun 10 12:57:14 2009
@@ -38,6 +38,7 @@
/**
* @see org.apache.click.Page#onInit()
*/
+ @Override
public void onInit() {
super.onInit();
@@ -49,6 +50,7 @@
/**
* @see org.apache.click.Page#onGet()
*/
+ @Override
public void onGet() {
String selectId = getContext().getRequestParameter(Tree.SELECT_TREE_NODE_PARAM);
String expandId = getContext().getRequestParameter(Tree.EXPAND_TREE_NODE_PARAM);
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java Wed Jun 10 12:57:14 2009
@@ -29,6 +29,7 @@
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.page.EditCustomer;
import org.apache.click.examples.service.CustomerService;
+import org.apache.click.util.Bindable;
import org.springframework.stereotype.Component;
/**
@@ -43,11 +44,11 @@
@Component
public class ActionTable extends BorderPage {
- public List customers;
- public Customer customerDetail;
- public ActionLink viewLink = new ActionLink(this, "onViewClick");
- public PageLink editLink = new PageLink(EditCustomer.class);
- public ActionLink deleteLink = new ActionLink(this, "onDeleteClick");
+ @Bindable public List customers;
+ @Bindable public Customer customerDetail;
+ @Bindable public ActionLink viewLink = new ActionLink(this, "onViewClick");
+ @Bindable public PageLink editLink = new PageLink(EditCustomer.class);
+ @Bindable public ActionLink deleteLink = new ActionLink(this, "onDeleteClick");
@Resource(name="customerService")
private CustomerService customerService;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/SimpleTable.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/SimpleTable.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/SimpleTable.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/SimpleTable.java Wed Jun 10 12:57:14 2009
@@ -33,6 +33,7 @@
/**
* @see Page#onRender()
*/
+ @Override
public void onRender() {
addModel("properties", new TreeMap(System.getProperties()));
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java Wed Jun 10 12:57:14 2009
@@ -29,6 +29,7 @@
import org.apache.click.extras.control.EmailField;
import org.apache.click.extras.control.IntegerField;
import org.apache.click.extras.control.PageSubmit;
+import org.apache.click.util.Bindable;
/**
* Provides a Velocity Macro example.
@@ -37,7 +38,7 @@
*/
public class VelocityMacro extends BorderPage {
- public Form form = new Form();
+ @Bindable public Form form = new Form();
public VelocityMacro() {
TextField nameField = new TextField("name", true);
@@ -65,4 +66,5 @@
form.add(new PageSubmit("cancel", HomePage.class));
form.add(new Reset("reset"));
}
+
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/SelectPostCode.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/SelectPostCode.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/SelectPostCode.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/SelectPostCode.java Wed Jun 10 12:57:14 2009
@@ -89,8 +89,10 @@
/**
* Override onRender to populate the table row data.
*/
+ @Override
public void onRender() {
List<PostCode> states = postCodeService.getPostCodes();
table.setRowList(states);
}
+
}
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step1.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step1.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step1.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step1.java Wed Jun 10 12:57:14 2009
@@ -32,6 +32,8 @@
*/
public class Step1 extends Step {
+ private static final long serialVersionUID = 1L;
+
/**
* Construct Step1 with the specified name, label, description and page.
*
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step2.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step2.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step2.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step2.java Wed Jun 10 12:57:14 2009
@@ -34,6 +34,8 @@
*/
public class Step2 extends Step {
+ private static final long serialVersionUID = 1L;
+
/** Reference to the postCode field. */
private IntegerField postCodeField;
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step3.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step3.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step3.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/Step3.java Wed Jun 10 12:57:14 2009
@@ -31,6 +31,8 @@
*/
public class Step3 extends Step {
+ private static final long serialVersionUID = 1L;
+
/**
* Construct Step3 with the specified name, label, description and page.
*
Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/WizardPage.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/WizardPage.java?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/WizardPage.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/page/wizard/WizardPage.java Wed Jun 10 12:57:14 2009
@@ -139,8 +139,10 @@
*
* @return the page stylesheet
*/
+ @Override
public String getHtmlImports() {
String contextPath = getContext().getRequest().getContextPath();
return "<link type=\"text/css\" rel=\"stylesheet\" href=\"" + contextPath + "/wizard/wizard.css\"/>";
}
+
}
Added: incubator/click/trunk/click/examples/src/org/apache/click/examples/util/ExampleUtils.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/util/ExampleUtils.java?rev=783339&view=auto
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/util/ExampleUtils.java (added)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/util/ExampleUtils.java Wed Jun 10 12:57:14 2009
@@ -0,0 +1,63 @@
+/*
+ * 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.util;
+
+import org.apache.click.Context;
+
+/**
+ * Provides examples helper methods.
+ *
+ * @author Malcolm Edgar
+ */
+public class ExampleUtils {
+
+ @SuppressWarnings("unchecked")
+ public static Object getSessionObject(Class aClass) {
+ if (aClass == null) {
+ throw new IllegalArgumentException("Null class parameter.");
+ }
+ Object object = getContext().getSessionAttribute(aClass.getName());
+ if (object == null) {
+ try {
+ object = aClass.newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return object;
+ }
+
+ public static void setSessionObject(Object object) {
+ if (object != null) {
+ getContext().setSessionAttribute(object.getClass().getName(), object);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public static void removeSessionObject(Class aClass) {
+ if (getContext().hasSession() && aClass != null) {
+ getContext().getSession().removeAttribute(aClass.getName());
+ }
+ }
+
+ private static Context getContext() {
+ return Context.getThreadLocalContext();
+ }
+
+}
Modified: incubator/click/trunk/click/examples/webapp/WEB-INF/click.xml
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/webapp/WEB-INF/click.xml?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/webapp/WEB-INF/click.xml (original)
+++ incubator/click/trunk/click/examples/webapp/WEB-INF/click.xml Wed Jun 10 12:57:14 2009
@@ -20,7 +20,7 @@
<click-app charset="UTF-8">
- <pages package="org.apache.click.examples.page" autobinding="public"/>
+ <pages package="org.apache.click.examples.page" autobinding="annotation"/>
<mode value="profile"/>
Modified: incubator/click/trunk/click/examples/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/webapp/WEB-INF/web.xml?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/webapp/WEB-INF/web.xml (original)
+++ incubator/click/trunk/click/examples/webapp/WEB-INF/web.xml Wed Jun 10 12:57:14 2009
@@ -1,161 +1,161 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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.
--->
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <display-name>Click Examples</display-name>
-
- <!--
- Spring configuration location.
- -->
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>WEB-INF/spring-beans.xml</param-value>
- </context-param>
-
- <!-- Filters -->
-
- <!--
- Provides a thread local Cayenne DataContext filter.
- -->
- <filter>
- <filter-name>DataContextFilter</filter-name>
- <filter-class>org.apache.click.extras.cayenne.DataContextFilter</filter-class>
- <init-param>
- <param-name>session-scope</param-name>
- <param-value>false</param-value>
- </init-param>
- </filter>
-
- <!--
- Provides a web application performance filter which compresses the response
- and sets the Expires header on selected static resources.
- The "cachable-paths" init parameter tells the filter resources can have
- their Expires header set so the browser will cache them.
- The "excludes-path" init parameter tells the filter which requests should
- be ignored by the filter.
- -->
- <filter>
- <filter-name>PerformanceFilter</filter-name>
- <filter-class>org.apache.click.extras.filter.PerformanceFilter</filter-class>
- <init-param>
- <param-name>cachable-paths</param-name>
- <param-value>/assets/*</param-value>
- </init-param>
- <init-param>
- <param-name>exclude-paths</param-name>
- <param-value>*/excel-export.htm</param-value>
- </init-param>
- </filter>
-
- <!--
- Provides a Spring Security (Acegi) filter.
- -->
- <filter>
- <filter-name>springSecurityFilterChain</filter-name>
- <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>DataContextFilter</filter-name>
- <servlet-name>ClickServlet</servlet-name>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>springSecurityFilterChain</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>PerformanceFilter</filter-name>
- <servlet-name>ClickServlet</servlet-name>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>PerformanceFilter</filter-name>
- <url-pattern>*.css</url-pattern>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>PerformanceFilter</filter-name>
- <url-pattern>*.js</url-pattern>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>PerformanceFilter</filter-name>
- <url-pattern>*.gif</url-pattern>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>PerformanceFilter</filter-name>
- <url-pattern>*.png</url-pattern>
- </filter-mapping>
-
- <!-- Listeners -->
-
- <!--
- The Quartz initialization listenger which loads the Quartz scheduler.
- -->
- <listener>
- <listener-class>org.quartz.ee.servlet.QuartzInitializerListener</listener-class>
- </listener>
-
- <!--
- The Spring Context Loader which initializes the Spring runtime.
- -->
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
-
- <!--
- Provides an in memory databae initialization listener. In a production
- application a separate database would be used, and this listener would not
- be needed.
- -->
- <listener>
- <listener-class>org.apache.click.examples.util.DatabaseInitListener</listener-class>
- </listener>
-
- <!-- Servlets -->
-
- <!--
- The Spring Click Servlet which handles *.htm requests.
- -->
- <servlet>
- <servlet-name>ClickServlet</servlet-name>
- <servlet-class>org.apache.click.extras.spring.SpringClickServlet</servlet-class>
- <load-on-startup>0</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>ClickServlet</servlet-name>
- <url-pattern>*.htm</url-pattern>
- </servlet-mapping>
-
- <!-- Wecome Files -->
-
- <welcome-file-list>
- <welcome-file>redirect.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>Click Examples</display-name>
+
+ <!--
+ Spring configuration location.
+ -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>WEB-INF/spring-beans.xml</param-value>
+ </context-param>
+
+ <!-- Filters -->
+
+ <!--
+ Provides a thread local Cayenne DataContext filter.
+ -->
+ <filter>
+ <filter-name>DataContextFilter</filter-name>
+ <filter-class>org.apache.click.extras.cayenne.DataContextFilter</filter-class>
+ <init-param>
+ <param-name>session-scope</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ </filter>
+
+ <!--
+ Provides a web application performance filter which compresses the response
+ and sets the Expires header on selected static resources.
+ The "cachable-paths" init parameter tells the filter resources can have
+ their Expires header set so the browser will cache them.
+ The "excludes-path" init parameter tells the filter which requests should
+ be ignored by the filter.
+ -->
+ <filter>
+ <filter-name>PerformanceFilter</filter-name>
+ <filter-class>org.apache.click.extras.filter.PerformanceFilter</filter-class>
+ <init-param>
+ <param-name>cachable-paths</param-name>
+ <param-value>/assets/*</param-value>
+ </init-param>
+ <init-param>
+ <param-name>exclude-paths</param-name>
+ <param-value>*/excel-export.htm</param-value>
+ </init-param>
+ </filter>
+
+ <!--
+ Provides a Spring Security (Acegi) filter.
+ -->
+ <filter>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>DataContextFilter</filter-name>
+ <servlet-name>ClickServlet</servlet-name>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PerformanceFilter</filter-name>
+ <servlet-name>ClickServlet</servlet-name>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PerformanceFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PerformanceFilter</filter-name>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PerformanceFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PerformanceFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+
+ <!-- Listeners -->
+
+ <!--
+ The Quartz initialization listenger which loads the Quartz scheduler.
+ -->
+ <listener>
+ <listener-class>org.quartz.ee.servlet.QuartzInitializerListener</listener-class>
+ </listener>
+
+ <!--
+ The Spring Context Loader which initializes the Spring runtime.
+ -->
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <!--
+ Provides an in memory databae initialization listener. In a production
+ application a separate database would be used, and this listener would not
+ be needed.
+ -->
+ <listener>
+ <listener-class>org.apache.click.examples.util.DatabaseInitListener</listener-class>
+ </listener>
+
+ <!-- Servlets -->
+
+ <!--
+ The Spring Click Servlet which handles *.htm requests.
+ -->
+ <servlet>
+ <servlet-name>ClickServlet</servlet-name>
+ <servlet-class>org.apache.click.extras.spring.SpringClickServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ClickServlet</servlet-name>
+ <url-pattern>*.htm</url-pattern>
+ </servlet-mapping>
+
+ <!-- Wecome Files -->
+
+ <welcome-file-list>
+ <welcome-file>redirect.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Modified: incubator/click/trunk/click/examples/webapp/control/menu-documentation.htm
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/webapp/control/menu-documentation.htm?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/webapp/control/menu-documentation.htm (original)
+++ incubator/click/trunk/click/examples/webapp/control/menu-documentation.htm Wed Jun 10 12:57:14 2009
@@ -32,6 +32,6 @@
<pre class="codeJava">
<span class="kw">public class</span> MenuPage <span class="kw">extends</span> BorderedPage {
- <span class="kw">public</span> Menu rootMenu = Menu.getRootMenu();
+ @Bindable <span class="kw">public</span> Menu rootMenu = Menu.getRootMenu();
}</pre>
Modified: incubator/click/trunk/click/examples/webapp/table/table-styles.htm
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/webapp/table/table-styles.htm?rev=783339&r1=783338&r2=783339&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/webapp/table/table-styles.htm (original)
+++ incubator/click/trunk/click/examples/webapp/table/table-styles.htm Wed Jun 10 12:57:14 2009
@@ -30,4 +30,4 @@
Table control styles (<a href="$context/click/table.css">table.css</a>)
are adapted from the CSS screen styles provided by
-<a href="http://displaytag.sourceforge.net">DisplayTag</a>.
+<a target="_blank" href="http://displaytag.sourceforge.net">DisplayTag</a>.