You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/07/16 19:55:26 UTC

svn commit: r422484 [5/5] - in /tapestry/tapestry4/trunk: ./ src/changes/ support/ tapestry-contrib/ tapestry-contrib/src/documentation/ tapestry-contrib/src/site/ tapestry-contrib/src/site/xdoc/ tapestry-contrib/src/site/xdoc/ComponentReference/

Added: tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/ComponentReference/XTile.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/ComponentReference/XTile.xml?rev=422484&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/ComponentReference/XTile.xml (added)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/ComponentReference/XTile.xml Sun Jul 16 10:55:23 2006
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Copyright 2005, 2006 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<document>
+    <properties>
+        <title>XTile</title>
+    </properties>
+    <body>
+
+        <section name="XTile">
+
+            <p>
+                A component providing the required JavaScript to pass some information to the server
+                and receive its response without reloading the page (Ajax)
+            </p>
+
+            <span class="warn">
+                <strong>Warning:</strong>
+                <p>
+                The
+                <a
+                    href="../../tapestry-contrib/apidocs/org/apache/tapestry/contrib/ajax/XTileService.html">
+                    XTileService
+                </a>
+                that this component uses does NOT activate any page - it simply calls the specified
+                listener. This means that pageBeginRender() methods will not get called and that
+                cycle.getPage() will return null.
+                </p>
+            </span>
+
+            <subsection name="Parameters">
+
+
+                <table>
+                    <tr>
+                        <th>Name</th>
+                        <th>Type</th>
+                        <th>Direction</th>
+                        <th>Required</th>
+                        <th>Default</th>
+                        <th>Description</th>
+                    </tr>
+
+                    <tr>
+                        <td>listener</td>
+                        <td>
+                            <a
+                                href="../../tapestry/apidocs/org/apache/tapestry/IActionListener.html">
+                                IActionListener
+                            </a>
+                        </td>
+                        <td>in</td>
+                        <td>yes</td>
+                        <td />
+                        <td>
+                            The listener that will be invoked when the Javascript function with the
+                            given name is invoked. Any parameters passed to the send function will
+                            be available from cycle.getListenerParameters(). In addition, the
+                            listener can perform cycle.setListenerParameters() to pass an array of
+                            strings to the JavaScript receive function.
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td>sendName</td>
+                        <td>String</td>
+                        <td>in</td>
+                        <td>yes</td>
+                        <td />
+                        <td>
+                            The name of the JavaScript function that the script will define to allow
+                            the application to send information to the server.
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td>receiveName</td>
+                        <td>String</td>
+                        <td>in</td>
+                        <td>yes</td>
+                        <td />
+                        <td>
+                            The name of the JavaScript function that the script will call to allow
+                            the application to receive information from the server some time after
+                            the send function has been invoked.
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td>errorName</td>
+                        <td>String</td>
+                        <td>in</td>
+                        <td>no</td>
+                        <td>null</td>
+                        <td>
+                            The name of the JavaScript function that the script will call to
+                            indicate that an error has occurred while sending the information to the
+                            server.
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td>disableCaching</td>
+                        <td>boolean</td>
+                        <td>in</td>
+                        <td>no</td>
+                        <td>false</td>
+                        <td>
+                            Some browsers cache repeated requests that have identical URLs. Pass
+                            'true' to this parameter to disable caching by making the URLs unique.
+                        </td>
+                    </tr>
+                </table>
+
+                <p>
+                    Body:
+                    <strong>removed</strong>
+                </p>
+
+                <p>
+                    Informal parameters:
+                    <strong>allowed</strong>
+                </p>
+
+                <p>
+                    Reserved parameters:
+                    <em>none</em>
+                </p>
+
+            </subsection>
+
+            <subsection name="Examples">
+
+                <p>
+                    The XTile example has portions implemented in the HTML and a listener method in
+                    the page class. They are broken down as follows:
+                </p>
+
+                <p>XTileExample.html</p>
+
+                <source xml:space="preserve">
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;XTile Example&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;span jwcid="@contrib:XTile" listener="ognl:listeners.handleListRequest"
+        sendName="sendPrefix" receiveName="recvList"/&gt;
+    &lt;form action="Results.html" method="post"&gt;
+       &lt;input type="text" onkeyup="sendPrefix(this.value)"/&gt;
+       &lt;br/&gt;
+       &lt;textarea name="listing" rows="5"&gt;&lt;/textarea&gt;
+    &lt;/form&gt;
+    &lt;script&gt;
+      function recvList(arr) {
+      	document.f.listing.value = arr.join("\n");
+      }
+    &lt;/script&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
+	</source>
+
+                <p>Then in your page class you just need to add the appropriate method.</p>
+
+                <p>XTileExample.java</p>
+                <source xml:space="preserve">
+    .
+    .
+    .
+    public void handleListRequest(IRequestCycle cycle) {
+      Object[] params = cycle.getListenerParameters();
+      if (params.length == 0) return;
+
+      String typed = params[0].toString();
+      String[] ret = findCompletions(typed);
+      cycle.setListenerParameters(ret);
+    }
+    .
+    .
+    .
+	</source>
+
+            </subsection>
+
+        </section>
+
+    </body>
+</document>

Propchange: tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/ComponentReference/XTile.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/index.xml?rev=422484&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/index.xml (added)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/index.xml Sun Jul 16 10:55:23 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Copyright 2005 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<document>
+    <properties>
+        <title>Tapestry Contrib Library</title>
+    </properties>
+    <body>
+
+        <section name="Tapestry Contrib Library">
+
+            <p>A collection of powerful add-on components for Tapestry.</p>
+            <p>
+                This library started as a collection of components
+                <em>contrib</em>
+                uted by the community.
+            </p>
+
+            <p>
+                To make use of this library, you must include its JAR on the classpath (typically,
+                by copying it into WEB-INF/lib), and extend your application specification, and add
+                a &lt;library&gt; element:
+            </p>
+
+            <source xml:space="preserve">
+ &lt;library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/&gt;
+</source>
+
+            <p>You may then reference the components of the framework using the prefix:</p>
+
+            <source xml:space="preserve">
+  &lt;table jwcid="@contrib:Table" ...&gt; ... 
+</source>
+
+            <p>
+                The prefix "contrib:" can be changed; if you don't like typing, make it "c:" ...
+                Tapestry doesn't care!
+            </p>
+
+        </section>
+
+    </body>
+</document>

Propchange: tapestry/tapestry4/trunk/tapestry-contrib/src/site/xdoc/index.xml
------------------------------------------------------------------------------
    svn:eol-style = native