More Parameters (2)

Int Param
1
Long Param
2
String Param
3
Double Param
4.321
Big Decimal Param
5.432
Boolean Param
true
Mode Param
Review
Mode2 Param
Create
Return
Look at the URL of this page. It is the page render request from the PageLink, and the activation context is at the end.

References: PageLink, Page Render Requests, Page Activation, Type Coercion.

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>More Parameters (2)</h3>
    
    <div class="eg">
        <t:beandisplay object="this" reorder="intParam,longParam,stringParam,doubleParam,bigDecimalParam,booleanParam,modeParam,mode2Param"/>
        <t:pagelink t:page="examples/navigation/MoreParameters1">Return</t:pagelink>
    </div>

    Look at the URL of this page. 
    It is the page render request from the PageLink, and the <strong>activation context</strong> is at the end.<br/><br/>
    
    References: 
    <a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/PageLink.html">PageLink</a>, 
    <a href="http://tapestry.apache.org/page-navigation.html#PageNavigation-PageRenderRequests">Page Render Requests</a>, 
    <a href="http://tapestry.apache.org/page-navigation.html#PageNavigation-Pageactivation">Page Activation</a>, 
    <a href="http://tapestry.apache.org/typecoercer-service.html">Type Coercion</a>.<br/><br/>

    <t:pagelink t:page="Index">Home</t:pagelink><br/><br/>

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


package jumpstart.web.pages.examples.navigation;

import java.math.BigDecimal;

import jumpstart.web.models.Mode;

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

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

    // The activation context

    @Property
    private int intParam;

    @Property
    private Long longParam;

    @Property
    private String stringParam;

    @Property
    private double doubleParam;

    @Property
    private BigDecimal bigDecimalParam;

    @Property
    private boolean booleanParam;

    @Property
    private Mode modeParam;

    @Property
    private Mode mode2Param;

    // The code

    // onActivate() is called by Tapestry to pass in the activation context from the URL.

    void onActivate(int intParam, Long longParam, String stringParam, double doubleParam, BigDecimal bigDecimalParam,
            boolean booleanParam, Mode modeParam, Mode mode2Param) {
        this.intParam = intParam;
        this.longParam = longParam;
        this.stringParam = stringParam;
        this.doubleParam = doubleParam;
        this.bigDecimalParam = bigDecimalParam;
        this.booleanParam = booleanParam;
        this.modeParam = modeParam;
        this.mode2Param = mode2Param;
    }

}


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


package jumpstart.web.models;

public enum Mode {
    CREATE, REVIEW, UPDATE, DELETE;
}