Request Types

The examples so far have involved one type of request: the page render request. To recap:

To send events - possibly containing input data - to the server, there is a second type of request: the component event request.

This is a really significant feature of Tapestry! Component event requests go straight back to the container, meaning the page or component that chose to render the component, rather than some "action handler". This is perfect! What could be better placed to understand the context and meaning of the event than the issuing component's container? This is what truly sets apart a component framework such as Tapestry from the many action frameworks out there.

The 2 most used components for generating component event requests are these:

Others include ActionLink and GridPager.

In later examples, when we use Ajax, we will find that it is possible for any component to send a component event request!

References: Page Navigation, Component Events, Ajax.

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>Request Types</h3>
    
    <p>The examples so far have involved one type of request: the <em>page render request</em>. To recap:</p>
    
    <ul>
        <li><strong>Page render requests</strong> target a specific page. They come from a PageLink.<br/>
        When the Tapestry server receives a page render request it activates the page, renders it to HTML, and returns it to the client.</li>
    </ul>

    <p>To send events - possibly containing input data - to the server, there is a second type of request: the <em>component event request</em>.</p>
    
    <ul>
        <li><strong>Component event requests</strong> target a specific component on the page. They often come from a Form or an EventLink.<br/>
        When the Tapestry server receives a component event request it activates the page, finds the component and triggers an event on it.<br/> 
        The component may bubble up events for the containing page or components to react to.</li>
    </ul>

    <p><strong>This is a really significant feature of Tapestry!</strong> Component event requests go straight back to the container, 
    meaning the page or component that chose to render the component, rather than some "action handler". This is perfect! 
    What could be better placed to understand the context and meaning of the event than the issuing component's container? 
    This is what truly sets apart a <em>component framework</em> such as Tapestry from the many <em>action frameworks</em> out there.</p>

    <p>The 2 most used components for generating <em>component event requests</em> are these:</p>

    <ul>
        <li><strong>Form</strong>.  When submitted, the request carries data fields to the corresponding Form on the server.</li>
        <li><strong>EventLink</strong>.  When clicked, the request carries the name of an event, plus parameters, to the corresponding 
            EventLink on the server.</li>
    </ul>

    <p>Others include <strong>ActionLink</strong> and <strong>GridPager</strong>.</p>
    
    <p>In later examples, when we use <strong>Ajax</strong>, we will find that it is possible for <strong><em>any</em> 
    component to send a component event request!</strong></p>

    References: 
    <a href="http://tapestry.apache.org/page-navigation.html">Page Navigation</a>, 
    <a href="http://tapestry.apache.org/component-events.html">Component Events</a>, 
    <a href="http://tapestry.apache.org/ajax-and-zones.html">Ajax</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/input/RequestTypes.tml"/>
        <t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/input/RequestTypes.java"/>
    </t:tabgroup>
</body>
</html>


package jumpstart.web.pages.examples.input;


public class RequestTypes {
}