git commit: TAP5-2223 : New "secure" flag in Select component has a bug when using option groups

2014-02-15 Thread ffacon
Repository: tapestry-5
Updated Branches:
  refs/heads/master 32e8e2f62 -> a4fe5cedc


TAP5-2223 : New "secure" flag in Select component has a bug when using option 
groups

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/a4fe5ced
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/a4fe5ced
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/a4fe5ced

Branch: refs/heads/master
Commit: a4fe5cedcd06ac5f438d04d9e3daaae1164a2381
Parents: 32e8e2f
Author: ffacon 
Authored: Sat Feb 15 16:22:05 2014 +0100
Committer: ffacon 
Committed: Sat Feb 15 16:22:05 2014 +0100

--
 tapestry-core/src/test/app1/OptionGroupForm.tml|  2 +-
 .../tapestry5/integration/app1/FormTests.java  | 17 +
 .../tapestry5/integration/app1/pages/Index.java|  2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a4fe5ced/tapestry-core/src/test/app1/OptionGroupForm.tml
--
diff --git a/tapestry-core/src/test/app1/OptionGroupForm.tml 
b/tapestry-core/src/test/app1/OptionGroupForm.tml
index 2722161..9ec0dca 100644
--- a/tapestry-core/src/test/app1/OptionGroupForm.tml
+++ b/tapestry-core/src/test/app1/OptionGroupForm.tml
@@ -2,7 +2,7 @@
 Simple Option Group 
 
 
-   
+

 
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a4fe5ced/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
index a45d1ed..946a0bb 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
@@ -1134,4 +1134,21 @@ public class FormTests extends App1TestCase
 clickAndWait(SUBMIT);
 assertTextPresent("Result = '!@#$%^&*()_+='");
 }
+
+/**
+ * TAP5-2223.
+ */
+@Test
+public void optionGroup_form()
+{
+openLinks("OptionGroupForm Demo");
+
+assertTextPresent("entity.id: [1]");
+
+select("entity", "label2");
+
+clickAndWait(SUBMIT);
+
+assertTextPresent("entity.id: [2]");
+}
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a4fe5ced/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index 0fa9207..6baf728 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -291,7 +291,7 @@ public class Index
 
 new Item("simpleform", "SimpleForm", "first pass at 
writing Form and TextField components"),
 
-new Item("OptionGroupForm", "OptionGroupForm", "Select 
with Option Group"),
+new Item("OptionGroupForm", "OptionGroupForm Demo", 
"Select with Option Group"),
 
 new Item("validform", "ValidForm", "server-side input 
validation"),
 



git commit: TAP5-2223 : New "secure" flag in Select component has a bug when using option groups

2014-02-14 Thread ffacon
Updated Branches:
  refs/heads/master 76982d56f -> 32e8e2f62


TAP5-2223 : New "secure" flag in Select component has a bug when using option 
groups


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/32e8e2f6
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/32e8e2f6
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/32e8e2f6

Branch: refs/heads/master
Commit: 32e8e2f626f9da1d64e13bbd7e572a33dd9cab22
Parents: 76982d5
Author: ffacon 
Authored: Fri Feb 14 15:32:48 2014 +0100
Committer: ffacon 
Committed: Fri Feb 14 15:32:48 2014 +0100

--
 .../tapestry5/corelib/components/Select.java|  2 +-
 tapestry-core/src/test/app1/OptionGroupForm.tml | 17 
 .../tapestry5/integration/app1/data/Entity.java | 51 +++
 .../tapestry5/integration/app1/pages/Index.java |  2 +
 .../integration/app1/pages/OptionGroupForm.java | 92 
 .../integration/app1/services/AppModule.java| 23 +
 6 files changed, 186 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/32e8e2f6/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
index df55fcb..031d892 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
@@ -294,7 +294,7 @@ public class Select extends AbstractField
 {
 for (OptionGroupModel og : model.getOptionGroups())
 {
-if (findInOptions(og.getOptions(), submittedValue))
+if (findInOptions(og.getOptions(), asSubmitted))
 {
 return asSubmitted;
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/32e8e2f6/tapestry-core/src/test/app1/OptionGroupForm.tml
--
diff --git a/tapestry-core/src/test/app1/OptionGroupForm.tml 
b/tapestry-core/src/test/app1/OptionGroupForm.tml
new file mode 100644
index 000..2722161
--- /dev/null
+++ b/tapestry-core/src/test/app1/OptionGroupForm.tml
@@ -0,0 +1,17 @@
+http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
+Simple Option Group 
+
+
+   
+   
+
+
+Entered data:
+
+
+entity.id: [${entity.id}]
+entity.label: [${entity.label}]
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/32e8e2f6/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/Entity.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/Entity.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/Entity.java
new file mode 100644
index 000..40c2bdc
--- /dev/null
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/Entity.java
@@ -0,0 +1,51 @@
+// Copyright 2014 The Apache Software Foundation
+//
+// Licensed 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.tapestry5.integration.app1.data;
+
+public class Entity {
+
+private String id;
+private String label;
+
+public String getLabel() {
+return label;
+}
+
+public void setLabel(String label) {
+this.label = label;
+}
+
+public String getId() {
+return id;
+}
+
+public void setId(String id) {
+this.id = id;
+}
+
+public Entity() {
+super();
+}
+
+public Entity(String id, String label) {
+super();
+this.id = id;
+this.label = label;
+}
+
+public boolean equals(Object obj) {
+return (obj == this) || (obj instanceof Entity) && id != null && 
id.equals(((Entity) obj).getId());
+}
+
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/32e8e2f6/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
--
diff --git 
a/tap