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 2013/08/27 09:20:59 UTC
[3/6] git commit: Simplify Checklist component and update for
Bootstrap 3
Simplify Checklist component and update for Bootstrap 3
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4a07baf3
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4a07baf3
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4a07baf3
Branch: refs/heads/master
Commit: 4a07baf321014c28d5b2bab6e04787d9acb197bc
Parents: 0c92881
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:33:00 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:33:00 2013 +0530
----------------------------------------------------------------------
.../tapestry5/corelib/components/Checklist.java | 2 +-
.../tapestry5/corelib/components/Checklist.tml | 6 ++++--
tapestry-core/src/test/app1/ChecklistDemo.tml | 21 +++++++-------------
3 files changed, 12 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
index 7e7131c..2f0616a 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
@@ -210,7 +210,7 @@ public class Checklist extends AbstractField
}
void beginRender(MarkupWriter writer) {
- writer.element("div", "class", "checkbox");
+ writer.element("div", "id", getClientId());
}
void afterRender(MarkupWriter writer) {
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
index 0be8d97..9cb8a0c 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
@@ -1,5 +1,7 @@
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
- <div t:type="loop" source="availableOptions" value="var:currentOption" class="t-checklist-row">
- <t:delegate to="var:currentOption"/>
+ <div t:type="loop" source="availableOptions" value="var:currentOption">
+ <div class="checkbox">
+ <t:delegate to="var:currentOption"/>
+ </div>
</div>
</t:container>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/test/app1/ChecklistDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/ChecklistDemo.tml b/tapestry-core/src/test/app1/ChecklistDemo.tml
index 77dfeac..8b142df 100644
--- a/tapestry-core/src/test/app1/ChecklistDemo.tml
+++ b/tapestry-core/src/test/app1/ChecklistDemo.tml
@@ -1,20 +1,13 @@
<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
- <t:form clientValidation="none">
- <p>
- <t:errors />
- </p>
- <p>
- <t:label for="selected" />
- :
- <t:checklist t:id="selected" validate="required" model="literal:Red,Green,Blue" encoder="encoder" label="Color"/>
+ <t:form clientValidation="none">
+ <t:errors/>
- </p>
+ <t:checklist t:id="selected" validate="required" model="literal:Red,Green,Blue"
+ encoder="encoder" label="Color"/>
- <p>
- <t:submit value="literal:Submit" />
- </p>
- </t:form>
+ <t:submit class="btn btn-primary" value="literal:Submit"/>
+ </t:form>
- <p>Selected colors: ${sorted}</p>
+ <p>Selected colors: ${sorted}</p>
</t:border>
\ No newline at end of file