Easy Output (Using BeanDisplay)

Tapestry's BeanDisplay component lets you display a JavaBean with very little effort. The bean in this example is this page!
Name
Jane Citizen
Age
25
Gender
Female
References: BeanDisplay, Using BeanEditForm (sic).

Home


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- We need a doctype to allow us to use special characters like &nbsp; 
     We use a "strict" DTD to make IE follow the alignment rules. -->
     
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
<body class="container">
    <h3>Easy Output (Using BeanDisplay)</h3>
    
    Tapestry's BeanDisplay component lets you display a <a href="http://en.wikipedia.org/wiki/JavaBeans">JavaBean</a> 
    with very little effort. The bean in this example is this page!
    
    <div class="eg">
        <t:beandisplay object="this" reorder="name,age,gender"/>
    </div>
    
    References: 
    <a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/BeanDisplay.html">BeanDisplay</a>,
    <a href="http://tapestry.apache.org/beaneditform-guide.html">Using BeanEditForm (sic)</a>.<br/><br/>
    
    <t:pagelink t:page="Index" href="#">Home</t:pagelink><br/><br/>

    <t:tabgroup>
        <t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/output/EasyOutput.tml"/>
        <t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/output/EasyOutput.java"/>
        <t:sourcecodetab src="/web/src/main/resources/META-INF/assets/css/examples/plain.css"/>
    </t:tabgroup>
</body>
</html>


package jumpstart.web.pages.examples.output;

import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Property;

@Import(stylesheet = "css/examples/plain.css")
public class EasyOutput {

    @Property
    private String name;

    @Property
    private Gender gender;

    @Property
    private Integer age;

    void setupRender() {

        name = "Jane Citizen";
        gender = Gender.FEMALE;
        age = 25;

    }

    private enum Gender {
        MALE, FEMALE;
    }

}


.eg {
                margin: 20px 0;
                padding: 14px;
                border: 1px solid #ddd;
                border-radius: 6px;
                -webkit-border-radius: 6px;
                -mox-border-radius: 6px;
}