You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2003/01/28 23:47:28 UTC
cvs commit: jakarta-tapestry/doc/src/ComponentReference Option.html
hlship 2003/01/28 14:47:28
Modified: framework/src/net/sf/tapestry/form Option.java Option.jwc
Select.java
web new.html
junit/src/net/sf/tapestry/junit/mock MockTestCase.java
doc/src/ComponentReference Option.html
Added: junit/context11 Three.html Result.html Four.html Six.html
Home.html Seven.html Five.html README Two.html
junit/context11/WEB-INF Three.page Two.page Four.page
Result.page Home.page
junit/src/net/sf/tapestry/junit/mock TestSelectOption.xml
junit/src/net/sf/tapestry/junit/mock/c11 Result.java
Four.java TestSelect.java TestPersistentSelect.java
Log:
[ 675882 ] option component generates invalid HTML
Revision Changes Path
1.1 jakarta-tapestry/junit/context11/Three.html
Index: Three.html
===================================================================
<html jwcid="@Shell" title="Three">
<body jwcid="@Body">
<form jwcid="@Form" listener="[[ listeners.formSubmit ]]">
<select jwcid="@Select" disabled="[[ true ]]">
<option/>
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
<input type="submit" value="Go"/>
</form>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/Result.html
Index: Result.html
===================================================================
<html jwcid="@Shell" title="Result">
<body>
<span jwcid="@Insert" value="[[ message ]]">Application message.</span>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/Four.html
Index: Four.html
===================================================================
<html jwcid="@Shell" title="Four">
<body jwcid="@Body">
<form jwcid="@Form" listener="[[ listeners.formSubmit ]]">
<select jwcid="@Select">
<option/>
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
<input type="submit" value="Go"/>
</form>
<form jwcid="@Form" direct="[[ false ]]" listener="[[ listeners.secondFormListener ]]"/>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/Six.html
Index: Six.html
===================================================================
<html jwcid="@Shell" title="Six">
<body jwcid="@Body">
<form jwcid="@Form">
<select jwcid="outer@Select">
<select jwcid="inner@Select">
<option/>
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
</select>
<input type="submit" value="Go"/>
</form>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/Home.html
Index: Home.html
===================================================================
<html jwcid="@Shell" title="Home">
<body jwcid="@Body">
<form jwcid="@Form" listener="[[ listeners.formSubmit ]]">
<select jwcid="@Select">
<option/>
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
<input type="submit" value="Go"/>
</form>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/Seven.html
Index: Seven.html
===================================================================
<html jwcid="@Shell" title="Seven">
<body jwcid="@Body">
<form jwcid="@Form">
<select>
<option/>
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
<input type="submit" value="Go"/>
</form>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/Five.html
Index: Five.html
===================================================================
<html jwcid="@Shell" title="Home">
<body jwcid="@Body">
<select jwcid="@Select">
<option/>
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
<input type="submit" value="Go"/>
</body>
</html>
1.1 jakarta-tapestry/junit/context11/README
Index: README
===================================================================
This context exists to test the Select and Option form components.
1.1 jakarta-tapestry/junit/context11/Two.html
Index: Two.html
===================================================================
<html jwcid="@Shell" title="Two">
<body jwcid="@Body">
<form jwcid="@Form" listener="[[ listeners.formSubmit ]]">
<select jwcid="@Select" multiple="[[ true ]]">
<option jwcid="@Option" selected="[[ animal ]]" label="Animal"/>
<option jwcid="@Option" selected="[[ vegetable ]]" label="Vegetable"/>
<option jwcid="@Option" selected="[[ mineral ]]">Mineral (or unknown)</option>
</select>
<input type="submit" value="Go"/>
</form>
</body>
</html>
1.12 +23 -26 jakarta-tapestry/framework/src/net/sf/tapestry/form/Option.java
Index: Option.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/net/sf/tapestry/form/Option.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Option.java 13 Jan 2003 03:33:19 -0000 1.11
+++ Option.java 28 Jan 2003 22:47:26 -0000 1.12
@@ -76,8 +76,7 @@
public class Option extends AbstractComponent
{
private IBinding _selectedBinding;
- private String _label;
-
+ private String _label;
public IBinding getSelectedBinding()
{
@@ -88,44 +87,37 @@
* Renders the <option> element, or responds when the form containing the element
* is submitted (by checking {@link Form#isRewinding()}.
*
- * <table border=1>
- * <tr> <th>attribute</th> <th>value</th> </tr>
- * <tr> <td>value</td> <td>from {@link Select#getNextOptionId()}</td> </tr>
- * <tr> <td>selected</td> <td>from selected property</td> </tr>
- * <tr> <td><i>other</i></td> <td>from extra bindings</td> </tr>
- * </tr>
- * </table>
- *
- * <p>If the <code>label</code> property is set, it is inserted after the
- * <option> tag.
+ * <p>If the <code>label</code> property is set, it is inserted inside the
+ * <option> element.
*
**/
- protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) throws RequestCycleException
+ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
+ throws RequestCycleException
{
- String value;
- Select select;
- boolean rewinding;
-
- select = Select.get(cycle);
+ Select select = Select.get(cycle);
if (select == null)
- throw new RequestCycleException(Tapestry.getString("Option.must-be-contained-by-select"), this);
+ throw new RequestCycleException(
+ Tapestry.getString("Option.must-be-contained-by-select"),
+ this);
// It isn't enough to know whether the cycle in general is rewinding, need to know
// specifically if the form which contains this component is rewinding.
- rewinding = select.isRewinding();
+ boolean rewinding = select.isRewinding();
- value = select.getNextOptionId();
+ String value = select.getNextOptionId();
if (rewinding)
{
if (!select.isDisabled())
_selectedBinding.setBoolean(select.isSelected(value));
+
+ renderBody(writer, cycle);
}
else
{
- writer.beginEmpty("option");
+ writer.begin("option");
writer.attribute("value", value);
@@ -134,10 +126,14 @@
generateAttributes(writer, cycle);
- if (_label != null)
+ if (_label != null)
+ {
writer.print(_label);
+ }
+
+ renderBody(writer, cycle);
- writer.println();
+ writer.end();
}
}
@@ -146,6 +142,7 @@
{
_selectedBinding = value;
}
+
public String getLabel()
{
return _label;
@@ -153,7 +150,7 @@
public void setLabel(String label)
{
- this._label = label;
+ _label = label;
}
}
1.7 +2 -2 jakarta-tapestry/framework/src/net/sf/tapestry/form/Option.jwc
Index: Option.jwc
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/net/sf/tapestry/form/Option.jwc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Option.jwc 26 Jan 2003 02:59:16 -0000 1.6
+++ Option.jwc 28 Jan 2003 22:47:26 -0000 1.7
@@ -4,7 +4,7 @@
"-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
-<component-specification class="net.sf.tapestry.form.Option" allow-body="no">
+<component-specification class="net.sf.tapestry.form.Option" allow-body="yes">
<description>
A single option within a Select.
1.13 +6 -3 jakarta-tapestry/framework/src/net/sf/tapestry/form/Select.java
Index: Select.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/net/sf/tapestry/form/Select.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Select.java 13 Jan 2003 03:33:19 -0000 1.12
+++ Select.java 28 Jan 2003 22:47:26 -0000 1.13
@@ -111,6 +111,11 @@
return (Select) cycle.getAttribute(ATTRIBUTE_NAME);
}
+ public void setDisabled(boolean disabled)
+ {
+ _disabled = disabled;
+ }
+
public boolean isDisabled()
{
return _disabled;
@@ -231,8 +236,6 @@
return null;
int length = parameters.length;
- if (parameters.length == 0)
- return null;
int size = (parameters.length > 30) ? 101 : 7;
1.1 jakarta-tapestry/junit/context11/WEB-INF/Three.page
Index: Three.page
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: Three.page,v 1.1 2003/01/28 22:47:26 hlship Exp $ -->
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
<page-specification class="net.sf.tapestry.junit.mock.c11.TestSelect"/>
1.1 jakarta-tapestry/junit/context11/WEB-INF/Two.page
Index: Two.page
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: Two.page,v 1.1 2003/01/28 22:47:26 hlship Exp $ -->
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
<page-specification class="net.sf.tapestry.junit.mock.c11.TestPersistentSelect"/>
1.1 jakarta-tapestry/junit/context11/WEB-INF/Four.page
Index: Four.page
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: Four.page,v 1.1 2003/01/28 22:47:26 hlship Exp $ -->
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
<page-specification class="net.sf.tapestry.junit.mock.c11.Four"/>
1.1 jakarta-tapestry/junit/context11/WEB-INF/Result.page
Index: Result.page
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: Result.page,v 1.1 2003/01/28 22:47:26 hlship Exp $ -->
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
<page-specification class="net.sf.tapestry.junit.mock.c11.Result">
<property-specification name="message" type="java.lang.String"/>
</page-specification>
1.1 jakarta-tapestry/junit/context11/WEB-INF/Home.page
Index: Home.page
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: Home.page,v 1.1 2003/01/28 22:47:26 hlship Exp $ -->
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
<page-specification class="net.sf.tapestry.junit.mock.c11.TestSelect"/>
1.122 +2 -1 jakarta-tapestry/web/new.html
Index: new.html
===================================================================
RCS file: /home/cvs/jakarta-tapestry/web/new.html,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- new.html 27 Jan 2003 21:31:38 -0000 1.121
+++ new.html 28 Jan 2003 22:47:28 -0000 1.122
@@ -25,6 +25,7 @@
<pre>
[ 665622 ] net.sf.tapestry.html.Frame uses old DOCTYPE
+[ 675882 ] option component generates invalid HTML
</pre>
<h3>Release 2.4-alpha-2</h3>
1.16 +12 -1 jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/MockTestCase.java
Index: MockTestCase.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/MockTestCase.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- MockTestCase.java 27 Jan 2003 21:31:38 -0000 1.15
+++ MockTestCase.java 28 Jan 2003 22:47:28 -0000 1.16
@@ -95,6 +95,17 @@
// in a static suite() method?
/**
+ * Tests the Select and Option components (and a bit of Form as well).
+ *
+ **/
+
+ public void testSelectOption()
+ throws Exception
+ {
+ attempt("TestSelectOption.xml");
+ }
+
+ /**
* Tests related to link renderers.
*
**/
1.1 jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/TestSelectOption.xml
Index: TestSelectOption.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: TestSelectOption.xml,v 1.1 2003/01/28 22:47:28 hlship Exp $ -->
<mock-test>
<context name="selopt" root="context11"/>
<servlet name="app" class="net.sf.tapestry.ApplicationServlet"/>
<request>
<assert-output name="Page Title">
<![CDATA[
<title>Home</title>
]]>
</assert-output>
<assert-output name="Form">
<![CDATA[
<form method="post" name="Form0" action="/selopt/app">
]]>
</assert-output>
<assert-output-matches name="Hidden Fields" subgroup="1">
<![CDATA[
<input type="hidden" (name="(.*?)" value="(.*?)")/>
]]>
<match>name="service" value="direct"</match>
<match>name="context" value="0/Home/$Form"</match>
<match>name="sp" value="S0"</match>
<match>name="Form0" value="$Select"</match>
</assert-output-matches>
<assert-output name="Select Tag">
<![CDATA[
<select name="$Select"> <option/>
]]>
</assert-output>
<assert-output-matches name="Option Tags">
<![CDATA[
<option value="(.*?)">(.*?)</option>
]]>
<match><![CDATA[<option value="0">Animal</option>]]></match>
<match><![CDATA[<option value="1">Vegetable</option>]]></match>
<match><![CDATA[<option value="2">Mineral (or unknown)</option>]]></match>
</assert-output-matches>
</request>
<!-- Submit the form, and specify nothing. -->
<request>
<parameter name="service" value="direct"/>
<parameter name="context" value="0/Home/$Form"/>
<parameter name="sp" value="S0"/>
<parameter name="Form0" value="$Select"/>
<assert-output name="Page Title">
<![CDATA[
<title>Result</title>
]]>
</assert-output>
<assert-output name="Selections">
Selections: none.
</assert-output>
</request>
<!-- Select one of the items. -->
<request>
<parameter name="service" value="direct"/>
<parameter name="context" value="0/Home/$Form"/>
<parameter name="sp" value="S0"/>
<parameter name="Form0" value="$Select"/>
<parameter name="$Select" value="1"/>
<assert-output name="Page Title">
<![CDATA[
<title>Result</title>
]]>
</assert-output>
<assert-output name="Selections">
Selections: vegetable.
</assert-output>
</request>
<!-- Go to the page with the persistent multiple options. -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Two"/>
<assert-output name="Page Title">
<![CDATA[
<title>Two</title>
]]>
</assert-output>
<assert-output name="Form">
<![CDATA[
<form method="post" name="Form0" action="/selopt/app">
]]>
</assert-output>
<assert-output-matches name="Hidden Fields" subgroup="1">
<![CDATA[
<input type="hidden" (name="(.*?)" value="(.*?)")/>
]]>
<match>name="service" value="direct"</match>
<match>name="context" value="0/Two/$Form"</match>
<match>name="sp" value="S0"</match>
<match>name="Form0" value="$Select"</match>
</assert-output-matches>
<assert-output name="Select Tag">
<![CDATA[
<select name="$Select" multiple="multiple">
]]>
</assert-output>
<assert-output-matches name="Option Tags">
<![CDATA[
<option value="(.*?)"(.*?)>(.*?)</option>
]]>
<match><![CDATA[<option value="0">Animal</option>]]></match>
<match><![CDATA[<option value="1">Vegetable</option>]]></match>
<match><![CDATA[<option value="2">Mineral (or unknown)</option>]]></match>
</assert-output-matches>
</request>
<!-- Select two items. -->
<request>
<parameter name="service" value="direct"/>
<parameter name="context" value="0/Two/$Form"/>
<parameter name="sp" value="S0"/>
<parameter name="Form0" value="$Select"/>
<parameter name="$Select">
<value>1</value>
<value>2</value>
</parameter>
<assert-output name="Page Title">
<![CDATA[
<title>Result</title>
]]>
</assert-output>
<assert-output name="Selections">
Selections: vegetable, mineral.
</assert-output>
</request>
<!-- Back to the page, see if the tags reflect right values. -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Two"/>
<assert-output name="Page Title">
<![CDATA[
<title>Two</title>
]]>
</assert-output>
<assert-output-matches name="Option Tags">
<![CDATA[
<option value="(.*?)"(.*?)>(.*?)</option>
]]>
<match><![CDATA[<option value="0">Animal</option>]]></match>
<match><![CDATA[<option value="1" selected="selected">Vegetable</option>]]></match>
<match><![CDATA[<option value="2" selected="selected">Mineral (or unknown)</option>]]></match>
</assert-output-matches>
</request>
<!-- Next up, a page that has a disabled Select. -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Three"/>
<assert-output name="Page Title">
<![CDATA[
<title>Three</title>
]]>
</assert-output>
<assert-output name="Form">
<![CDATA[
<form method="post" name="Form0" action="/selopt/app">
]]>
</assert-output>
<assert-output-matches name="Hidden Fields" subgroup="1">
<![CDATA[
<input type="hidden" (name="(.*?)" value="(.*?)")/>
]]>
<match>name="service" value="direct"</match>
<!-- Remember the persistent properties? Those made the app go stateful. -->
<match>name="context" value="1/Three/$Form"</match>
<match>name="sp" value="S0"</match>
<match>name="Form0" value="$Select"</match>
</assert-output-matches>
<assert-output name="Select Tag">
<![CDATA[
<select name="$Select" disabled="disabled">
]]>
</assert-output>
<assert-output-matches name="Option Tags">
<![CDATA[
<option value="(.*?)"(.*?)>(.*?)</option>
]]>
<match><![CDATA[<option value="0">Animal</option>]]></match>
<match><![CDATA[<option value="1">Vegetable</option>]]></match>
<match><![CDATA[<option value="2">Mineral (or unknown)</option>]]></match>
</assert-output-matches>
</request>
<!-- Pretend to be a browser that ignores the disabled flag on the select.
Check that the values are ignored. -->
<request>
<parameter name="service" value="direct"/>
<parameter name="context" value="1/Three/$Form"/>
<parameter name="sp" value="S0"/>
<parameter name="Form0" value="$Select"/>
<parameter name="$Select" value="1"/>
<assert-output name="Page Title">
<![CDATA[
<title>Result</title>
]]>
</assert-output>
<assert-output name="Selections">
Selections: none.
</assert-output>
</request>
<!-- Page Four has a second form that uses the action service. We check
that the form containing the Select ignores the request property. -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Four"/>
<assert-output name="Page Title">
<![CDATA[
<title>Four</title>
]]>
</assert-output>
<assert-output name="Second Form">
<![CDATA[
<form method="post" name="Form1" action="/selopt/app">
]]>
</assert-output>
</request>
<!-- Submit the second form. -->
<request>
<parameter name="service" value="action"/>
<parameter name="context" value="1/Four/1/$Form_0"/>
<parameter name="Form1" value=""/>
<assert-output name="Page Title">
<![CDATA[
<title>Result</title>
]]>
</assert-output>
<assert-output name="Message">
Second form triggered.
</assert-output>
</request>
<!-- And on to the degenerate cases. -->
<!-- #1 Select not in a Form. -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Five"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Message">
This component must be contained within a Form.
</assert-output>
</request>
<!-- #2 Nested Selects. -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Six"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Message">
Select components may not be nested.
</assert-output>
</request>
<!-- #3: Option not in a Select -->
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="Seven"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Message">
Option component must be contained within a Select.
</assert-output>
</request>
</mock-test>
1.1 jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c11/Result.java
Index: Result.java
===================================================================
/*
* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Tapestry" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Tapestry", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package net.sf.tapestry.junit.mock.c11;
import net.sf.tapestry.html.BasePage;
/**
* Displays a message summarizing the results identified by the page.
*
* @author Howard Lewis Ship
* @version $Id: Result.java,v 1.1 2003/01/28 22:47:28 hlship Exp $
* @since 2.4
*
**/
public abstract class Result extends BasePage
{
public abstract String getMessage();
public abstract void setMessage(String message);
}
1.1 jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c11/Four.java
Index: Four.java
===================================================================
/*
* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Tapestry" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Tapestry", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package net.sf.tapestry.junit.mock.c11;
import net.sf.tapestry.IRequestCycle;
public class Four extends TestSelect
{
public void secondFormListener(IRequestCycle cycle)
{
Result result = (Result)cycle.getPage("Result");
result.setMessage("Second form triggered.");
cycle.setPage(result);
}
}
1.1 jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c11/TestSelect.java
Index: TestSelect.java
===================================================================
/*
* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Tapestry" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Tapestry", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package net.sf.tapestry.junit.mock.c11;
import net.sf.tapestry.IRequestCycle;
import net.sf.tapestry.html.BasePage;
/**
* Used to test the Select and Option elements.
*
*
* @author Howard Lewis Ship
* @version $Id: TestSelect.java,v 1.1 2003/01/28 22:47:28 hlship Exp $
* @since 2.4
**/
public class TestSelect extends BasePage
{
private boolean _animal;
private boolean _mineral;
private boolean _vegetable;
public void initialize()
{
_animal = false;
_mineral = false;
_vegetable = false;
}
public boolean isAnimal()
{
return _animal;
}
public boolean isMineral()
{
return _mineral;
}
public boolean isVegetable()
{
return _vegetable;
}
public void setAnimal(boolean animal)
{
_animal = animal;
}
public void setMineral(boolean mineral)
{
_mineral = mineral;
}
public void setVegetable(boolean vegetable)
{
_vegetable = vegetable;
}
public void formSubmit(IRequestCycle cycle)
{
StringBuffer buffer = new StringBuffer("Selections: ");
boolean needComma = false;
if (_animal)
{
buffer.append("animal");
needComma = true;
}
if (_vegetable)
{
if (needComma)
buffer.append(", ");
buffer.append("vegetable");
needComma = true;
}
if (_mineral)
{
if (needComma) buffer.append(", ");
buffer.append("mineral");
needComma = true;
}
if (!needComma)
buffer.append("none");
buffer.append(".");
Result result = (Result)cycle.getPage("Result");
String message = buffer.toString();
result.setMessage(message);
cycle.setPage(result);
}
}
1.1 jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c11/TestPersistentSelect.java
Index: TestPersistentSelect.java
===================================================================
/*
* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Tapestry" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Tapestry", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package net.sf.tapestry.junit.mock.c11;
/**
* Makes the three properties persistent.
*
* @author Howard Lewis Ship
* @version $Id: TestPersistentSelect.java,v 1.1 2003/01/28 22:47:28 hlship Exp $
* @since 2.4
**/
public class TestPersistentSelect extends TestSelect
{
public void setAnimal(boolean animal)
{
super.setAnimal(animal);
fireObservedChange("animal", animal);
}
public void setMineral(boolean mineral)
{
super.setMineral(mineral);
fireObservedChange("mineral", mineral);
}
public void setVegetable(boolean vegetable)
{
super.setVegetable(vegetable);
fireObservedChange("vegetable", vegetable);
}
}
1.8 +2 -2 jakarta-tapestry/doc/src/ComponentReference/Option.html
Index: Option.html
===================================================================
RCS file: /home/cvs/jakarta-tapestry/doc/src/ComponentReference/Option.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Option.html 30 Aug 2002 23:32:57 -0000 1.7
+++ Option.html 28 Jan 2003 22:47:28 -0000 1.8
@@ -112,7 +112,7 @@
</td>
</tr>
</table><BR>Body:
- <STRONG>removed</STRONG><BR>Informal parameters:
+ <STRONG>allowed</STRONG><BR>Informal parameters:
<STRONG>allowed</STRONG>
<br>
Reserved parameters: "value"