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 2008/02/05 02:40:17 UTC
svn commit: r618505 - in /tapestry/tapestry5/trunk:
tapestry-component-report/src/main/java/org/apache/tapestry/mojo/
tapestry-core/src/main/java/org/apache/tapestry/corelib/components/
tapestry-core/src/main/resources/org/apache/tapestry/corelib/compo...
Author: hlship
Date: Mon Feb 4 17:40:16 2008
New Revision: 618505
URL: http://svn.apache.org/viewvc?rev=618505&view=rev
Log:
TAPESTRY-2076: Component report should break out as one class per page and include examples
Added:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/beandisplay_ref.png (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref1.png (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref2.png (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref1.png (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref2.png (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/radio_ref.png (with props)
Modified:
tapestry/tapestry5/trunk/tapestry-component-report/src/main/java/org/apache/tapestry/mojo/ComponentReport.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditor.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Radio.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/RadioGroup.xdoc
Modified: tapestry/tapestry5/trunk/tapestry-component-report/src/main/java/org/apache/tapestry/mojo/ComponentReport.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-component-report/src/main/java/org/apache/tapestry/mojo/ComponentReport.java?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-component-report/src/main/java/org/apache/tapestry/mojo/ComponentReport.java (original)
+++ tapestry/tapestry5/trunk/tapestry-component-report/src/main/java/org/apache/tapestry/mojo/ComponentReport.java Mon Feb 4 17:40:16 2008
@@ -178,9 +178,15 @@
Sink sink = getSink();
+ sink.head();
+ sink.title();
+ sink.text("Component Reference");
+ sink.title_();
+ sink.head_();
+
sink.section1();
sink.sectionTitle1();
- sink.text("Component Index");
+ sink.text("Component Reference");
sink.sectionTitle1_();
sink.list();
@@ -326,14 +332,15 @@
int depth = packageName.split("\\.").length;
- // One extra to account for the "ref" directory.
- for (int i = 0; i <= depth; i++)
+ for (int i = 0; i < depth; i++)
{
javadocURL.append("../");
}
- javadocURL.append(apidocs).append("/").append(toPath(className)).append(".html");
+ String pathToRefRoot = javadocURL.toString();
+
+ javadocURL.append("../").append(apidocs).append("/").append(toPath(className)).append(".html");
addLink(addChild(section, "p"), javadocURL.toString(), "[JavaDoc]");
@@ -401,7 +408,7 @@
addChild(body, "hr");
- addLink(addChild(body, "p"), "index.html", "Back to index");
+ addLink(addChild(body, "p"), pathToRefRoot + "index.html", "Back to index");
Document document = new Document(root);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java Mon Feb 4 17:40:16 2008
@@ -37,6 +37,14 @@
private boolean _disabled;
/**
+ * The user presentable label for the field. If not provided, a reasonable label is generated from the component's
+ * id, first by looking for a message key named "id-label" (substituting the component's actual id), then by
+ * converting the actual id to a presentable string (for example, "userId" to "User Id").
+ */
+ @Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
+ private String _label;
+
+ /**
* Allows a specific implementation of {@link ValueEncoder} to be supplied. This is used to create client-side
* string values for the different radio button values.
*
@@ -73,6 +81,11 @@
return _defaultProvider.defaultBinding("value", _resources);
}
+ String defaultLabel()
+ {
+ return _defaultProvider.defaultLabel(_resources);
+ }
+
final ValueEncoder defaultEncoder()
{
return _valueEncoderSource.getEncoderForParameter("value", _resources);
@@ -167,7 +180,7 @@
}
/**
- * Pops the {@link RadioContainer}.
+ * Pops the {@link RadioContainer} off the Environment.
*/
final void afterRender()
{
@@ -179,13 +192,9 @@
return _elementName;
}
- /**
- * Always returns null; individual {@link org.apache.tapestry.corelib.components.Radio} components may have their
- * own label.
- */
public String getLabel()
{
- return null;
+ return _label;
}
public boolean isDisabled()
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc Mon Feb 4 17:40:16 2008
@@ -1,21 +1,34 @@
<document>
<body>
+
+ <section name="Related Components">
+
+ <ul>
+ <li>
+ <a href="BeanEditForm.html">BeanEditForm</a>
+ </li>
+ <li>
+ <a href="Grid.html">Grid</a>
+ </li>
+ </ul>
+
+ </section>
+
<section name="Examples">
<p>
- The bean to display will be a property of the containing page. In this example we are making
- the bean a persistent property, but there are other options. Presumably, some other page
- obtains the bean and invokes the setBean() method.
+ Here, we'll display a User object, consisting
+ of a first name, last name and age. We'll also customize the output of the last name property, to
+ display the name in all upper-case. The result:
</p>
<p>
- You may pass override parameters for specific properties, in which case you have control
- over how that property will be rendered. As an example, we'll render the lastName as upper-case.
+ <img src="beandisplay_ref.png"/>
</p>
- <subsection name="MyBean.java">
+ <subsection name="User.java">
<source><![CDATA[
-public class MyBean
+public class User
{
private long _id;
@@ -43,39 +56,42 @@
public void setAge(int age) { _age = age; }
}]]></source>
- <p>The @NonVisual annotation prevents the id from being displayed.</p>
+ <p>The @NonVisual annotation prevents the id property from being displayed.</p>
</subsection>
- <subsection name="MyPage.java">
+ <subsection name="ViewUser.java">
<source><![CDATA[
-public class MyPage
+public class ViewUser
{
@Persist
- private MyBean _bean;
+ private User _user;
- public MyBean getBean()
+ public User getUser()
{
- return _bean;
+ return _user;
}
- public void setBean(MyBean bean)
+ public void setUser(User user)
{
- _bean = bean;
+ _user = user;
}
}]]></source>
+ <p>
+ Presumably, some other page is obtaining the User instance and invoking the setUser() method.
+ </p>
</subsection>
- <subsection name="MyPage.tml">
+ <subsection name="ViewUser.tml">
<source><![CDATA[
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
- <h1>My Bean</h1>
+ <h1>View User</h1>
- <t:beandisplay object="bean">
+ <t:beandisplay object="user">
<t:parameter name="lastname">
${bean.lastname.toUpperCase()}
</t:parameter>
@@ -87,8 +103,7 @@
<p>
The
<code><![CDATA[<t:parameter>]]></code>
- element
- is an
+ element is an
<em>override</em>
for the property. The name is
matched against a property of the bean.
@@ -101,8 +116,6 @@
</p>
</subsection>
-
-
</section>
<section name="Notes">
@@ -111,11 +124,12 @@
You can re-order the properties using the reorder parameter:
</p>
- <source><![CDATA[<t:beandisplay object="bean" reorder="lastname,firstname"/>]]></source>
+ <source><![CDATA[<t:beandisplay object="user" reorder="lastname,firstname"/>]]></source>
<p>
You can accomplish the same thing by changing the order of the
- getter methods in the bean class (that sets the default order).
+ getter methods in the bean class. The default order in which properties are
+ displayed is not alphabetical, it is the order of the getter methods.
</p>
<p>
@@ -127,6 +141,20 @@
You might find
<code><![CDATA[<t:beandisplay object="this"/>]]></code>
useful on occasion. It will display all the properties of the current page.
+ </p>
+
+ <p>
+ As with the
+ <a href="BeanEditForm.html">BeanEditForm</a>
+ component,
+ you may override the labels displayed for the fields using
+ the page's message catalog.
+ </p>
+
+ <p>
+ Please refer to the
+ <a href="PageLink.html">PageLink</a>
+ component documentation for an alternate way to manage _user field.
</p>
</section>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.xdoc Mon Feb 4 17:40:16 2008
@@ -5,8 +5,23 @@
The BeanEditForm component is a convienent wrapper around three components:
<a href="Form.html">Form</a>,
<a href="Errors.html">Errors</a>
- and<a href="BeanEditor.html">BeanEditor</a>.
+ and
+ <a href="BeanEditor.html">BeanEditor</a>.
</p>
+
+
+ <section name="Related Components">
+
+ <ul>
+ <li>
+ <a href="BeanDisplay.html">BeanDisplay</a>
+ </li>
+ <li>
+ <a href="Grid.html">Grid</a>
+ </li>
+ </ul>
+
+ </section>
<section name="Simple Example">
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditor.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditor.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditor.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanEditor.xdoc Mon Feb 4 17:40:16 2008
@@ -1,7 +1,8 @@
<document>
<body>
- See the
- <a href="BeanEditForm.html">BeanEditForm</a>
- documentation for examples of how to use and customize this component.
+ <p>See the
+ <a href="BeanEditForm.html">BeanEditForm</a>
+ documentation for examples of how to use and customize this component.
+ </p>
</body>
</document>
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.xdoc?rev=618505&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.xdoc (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.xdoc Mon Feb 4 17:40:16 2008
@@ -0,0 +1,58 @@
+<document>
+ <body>
+ <section name="Related Components">
+ <ul>
+ <li>
+ <a href="Form.html">Form</a>
+ </li>
+ <li>
+ <a href="TextField.html">TextField</a>
+ </li>
+ </ul>
+ </section>
+
+ <section name="Examples">
+ <p>
+ The DateField component is very easy to use, all the JavaScript is generated for you. Then end result
+ looks like:
+ </p>
+
+ <p>
+ <img src="datefield_ref1.png"/>
+ </p>
+
+ <p>
+ Clicking the icon raises the popup calendar:
+ </p>
+
+ <p>
+ <img src="datefield_ref2.png"/>
+ </p>
+
+ <subsection name="DateFieldDemo.tml">
+ <source><![CDATA[<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <body>
+ <t:form>
+ <div class="t-beaneditor">
+ <div class="t-beaneditrow">
+ <t:label for="date"/>
+ <t:datefield t:id="date"/>
+ </div>
+ <div class="t-beaneditrow">
+ <input type="submit" value="Update"/>
+ </div>
+ </div>
+ </t:form>
+ </body>
+</html>]]></source>
+ </subsection>
+
+ <p>
+ The use of the extra <div> elements is to trigger the CSS styles that are
+ usually used as part of a<a href="BeanEditForm.html">BeanEditForm</a>. Just the
+ <code><![CDATA[<t:datefield>]]></code>
+ element is all that's really necessary.
+ </p>
+ </section>
+ </body>
+</document>
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc Mon Feb 4 17:40:16 2008
@@ -1,5 +1,16 @@
<document>
<body>
+ <section name="Related Components">
+ <ul>
+ <li>
+ <a href="BeanEditForm">BeanEditForm</a>
+ </li>
+ <li>
+ <a href="BeanDisplay">BeanDisplay</a>
+ </li>
+ </ul>
+ </section>
+
<section name="Simple Example">
<p>
@@ -7,7 +18,22 @@
underlying concept and share quite a bit of code.
</p>
- <p>In this example, we'll display a list of users.</p>
+ <p>In this example, we'll display a list of users. We'll also show some basic customization, to convert a
+ column
+ from just text, to a clickable link.
+ </p>
+
+ <p>
+ <img src="grid_ref1.png"/>
+ </p>
+
+ <p>This example shows much of the default behavior, using a collection of randomly generated users.
+ The column order is determined by the order of the getter methods in the User class. The columns are
+ sortable, and
+ because there are more results than will fit on a single page, page navigation is included (the
+ navigation
+ disappears for small result sets).
+ </p>
<subsection name="User.java">
<source><![CDATA[
@@ -39,7 +65,7 @@
public void setAge(int age) { _age = age; }
}]]></source>
- <p>The @NonVisual annotation prevents the id from being displayed.</p>
+ <p>The @NonVisual annotation prevents the id property from being displayed.</p>
</subsection>
@@ -57,7 +83,7 @@
<t:grid source="users" row="user">
<t:parameter name="lastnamecell">
- <t:pagelink page="viewuser" context="user.id">${user.lastname}</t:pagelink>
+ <t:pagelink page="user/view" context="user.id">${user.lastname}</t:pagelink>
</t:parameter>
</t:grid>
</body>
@@ -69,8 +95,7 @@
The parameter name
<code><em>property</em>cell
</code>
- is used
- to override the rendering of cells for one property. As usual, case is ignored. Here we
+ is used to override the rendering of cells for one property. As usual, case is ignored. Here we
use a PageLink component to link to a ViewUser page, passing the id of the user as
activation context for the target page.
</p>
@@ -83,6 +108,7 @@
</p>
<p>
+ <strong>Note:</strong>
Overriding of headers, the clickable links at the top of columns, is not yet implemented.
</p>
@@ -108,7 +134,8 @@
<p>
The UserList class exists to provide access to the UserDAO service, and to act as a holder
- for the user property, needed when the Grid is rendering.
+ for the user property, needed when the Grid is rendering. We need it here because we've
+ overridden the rendering of the lastName property.
</p>
</section>
@@ -123,18 +150,22 @@
<subsection name="UserList.tml">
<p>
- We want to make the user's last name a clickable link to a detail page for the user.
+ We want to make the user's last name a clickable link to delete
+ the user for that row.
</p>
+ <p>
+ <img src="grid_ref2.png"/>
+ </p>
<source><![CDATA[
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
<h1>List Users</h1>
- <t:grid source="users" model="model" row="user">
+ <t:grid source="users" row="user" model="model">
<t:parameter name="lastnamecell">
- <t:pagelink page="viewuser" context="user.id">${user.lastname}</t:pagelink>
+ <t:pagelink page="user/view" context="user.id">${user.lastname}</t:pagelink>
</t:parameter>
<t:parameter name="deletecell">
<t:actionlink t:id="delete" context="user.id">Delete</t:actionlink>
@@ -171,7 +202,7 @@
private final BeanModel _model;
{
- _model = _source.create(User.class, true, _resources);
+ _model = _beanModelSource.create(User.class, true, _resources);
_model.add("delete", null);
}
@@ -189,7 +220,7 @@
void onActionFromDelete(long userId)
{
_userDAO.remove(userId);
- }
+ }
}]]></source>
<p>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc Mon Feb 4 17:40:16 2008
@@ -1,17 +1,88 @@
<document>
<body>
+
+ <section name="Related Components">
+ <ul>
+ <li>
+ <a href="ActionLink.html">ActionLink</a>
+ </li>
+ <li>
+ <a href="EventLink.html">EventLink</a>
+ </li>
+ </ul>
+ </section>
+
<section name="Examples">
<p>
- This will be a set of examples about PageLink.
+ We're continuing with the example introduced in the
+ <a href="Grid.html">Grid</a>
+ examples.
</p>
- </section>
-
- <section name="Notes">
<p>
- This will be more notes about PageLink.
+ The UserList page renders a series of page links, passing the user id as the context:
</p>
+
+ <subsection name="UserList.html (partial)">
+ <source><![CDATA[
+ <t:grid source="users" row="user" model="model">
+ <t:parameter name="lastnamecell">
+ <t:pagelink page="user/view" context="user.id">${user.lastname}</t:pagelink>
+ </t:parameter>
+
+ </t:grid>]]></source>
+ </subsection>
+
+
+ <subsection name="ViewUser.java">
+
+ <p>
+ The ViewUser page is responsible for converting that user id back into a User instance,
+ by providing an event handler method for the "activate" event.
+ </p>
+
+ <source><![CDATA[
+public class ViewUser
+{
+ private User _user;
+
+ @Inject
+ private UserDAO _userDAO;
+
+ public User getUser()
+ {
+ return _user;
+ }
+
+ void onActivate(long userId)
+ {
+ _user = _userDAO.findById(userId);
+ }
+}
+ ]]></source>
+
+ </subsection>
+
+ <subsection name="ViewUser.tml">
+ <source><![CDATA[
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <body>
+ <h1>View User</h1>
+
+ <t:beandisplay object="user"/>
+ </body>
+</html>]]></source>
+
+ <p>
+ Rendering out the User object, using a
+ <a href="BeanDisplay.html">BeanDisplay</a>
+ component, is easy, and the template doesn't have to know or
+ care about the context, it just reads the user property.
+ </p>
+
+ </subsection>
+
</section>
</body>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Radio.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Radio.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Radio.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Radio.xdoc Mon Feb 4 17:40:16 2008
@@ -1,9 +1,23 @@
<document>
<body>
+
+ <section name="Related Components">
+
+ <ul>
+ <li>
+ <a href="Form.html">Form</a>
+ </li>
+ <li>
+ <a href="Select.html">Select</a>
+ </li>
+ </ul>
+
+ </section>
+
<section name="Examples">
<p>
Radio components are always used in conjunction with
- a RadioGroup component. The RadioComponent defines the property
+ a RadioGroup component. The RadioGroup defines the property
that will be read and updated, and the individual Radio
components determine what value will be assigned to the property.
</p>
@@ -14,6 +28,10 @@
a set of radio buttons for choosing the type of credit card.
</p>
+ <p>
+ <img src="radio_ref.png"/>
+ </p>
+
<subsection name="CardType.java">
<source><![CDATA[
@@ -25,19 +43,39 @@
</subsection>
- <subsection name="Payment.tml (partial)">
+ <subsection name="Payment.tml">
<source><![CDATA[
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <body>
+ <h1>Order Payment</h1>
+
+ <t:form>
+ <t:label for="cardNumber"/>:
+
+ <t:textfield t:id="cardNumber" size="16"/>
+
+ <br/>
+
+ <t:label for="type"/>:
+
+ <t:radiogroup t:id="type" t:encoder="cardTypeEncoder">
+ <t:radio t:id="masterCard"/>
+ <t:label for="masterCard"/>
+ <t:radio t:id="visa"/>
+ <t:label for="visa"/>
+ <t:radio t:id="amex"/>
+ <t:label for="amex"/>
+ <t:radio t:id="dinersClub"/>
+ <t:label for="dinersClub"/>
+ <t:radio t:id="discover"/>
+ <t:label for="discover"/>
+ </t:radiogroup>
- <t:radiogroup t:id="type" t:encoder="cardTypeEncoder"/>
- <t:radio t:id="masterCard"/> <t:label for="masterCard"/>
- <t:radio t:id="visa"/> <t:label for="visa"/>
- <t:radio t:id="amex"/> <t:label for="amex"/>
- <t:radio t:id="dinersClub"/> <t:label for="dinersClub"/>
- <t:radio t:id="discover"/> <t:label for="discover"/>
- </t:radiogroup>
+ </t:form>
- ]]></source>
+ </body>
+</html>]]></source>
<p>
The advantage of using radio buttons here, rather than a drop down list,
@@ -90,7 +128,7 @@
<p>
We use a number of read-only properties to provide
- each Radio component with its Enum value, that will
+ each Radio component with its corresponding enum value, that will
ultimately be assigned to the page's type property
(if that corresponding Radio component is selected by the user).
</p>
@@ -101,6 +139,18 @@
than you will use a whole array of Radio components as in this example.
</p>
+ </subsection>
+
+ <subsection name="Payment.properties">
+
+ <p>
+ We override the default generated labels for a few fields and enum values:
+ </p>
+
+ <source><![CDATA[
+cardnumber-label=Credit Card Number
+type-label=Credit Card Type
+dinersclub-label=Diner's Club]]></source>
</subsection>
</section>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/RadioGroup.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/RadioGroup.xdoc?rev=618505&r1=618504&r2=618505&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/RadioGroup.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/RadioGroup.xdoc Mon Feb 4 17:40:16 2008
@@ -1,10 +1,9 @@
<document>
<body>
- <section name="Examples">
-
- <p>
- Examples are provided with the documentation of the Radio component.
- </p>
- </section>
+ <p>
+ Examples are provided with the documentation of the
+ <a href="Radio.html">Radio</a>
+ component.
+ </p>
</body>
</document>
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/beandisplay_ref.png
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/beandisplay_ref.png?rev=618505&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/beandisplay_ref.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref1.png
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref1.png?rev=618505&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref1.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref2.png
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref2.png?rev=618505&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/datefield_ref2.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref1.png
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref1.png?rev=618505&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref1.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref2.png
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref2.png?rev=618505&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/grid_ref2.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/radio_ref.png
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/radio_ref.png?rev=618505&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/radio_ref.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream