Author: buildbot
Date: Mon Jun  1 18:19:57 2015
New Revision: 953464

Log:
Production update by buildbot for tapestry

Modified:
    websites/production/tapestry/content/ajax-components-faq.html
    websites/production/tapestry/content/cache/main.pageCache

Modified: websites/production/tapestry/content/ajax-components-faq.html
==============================================================================
--- websites/production/tapestry/content/ajax-components-faq.html (original)
+++ websites/production/tapestry/content/ajax-components-faq.html Mon Jun  1 
18:19:57 2015
@@ -153,10 +153,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 </div></div><p>But when the form is inside a Zone and rendered as part of a 
zone update, the ids get weird:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" 
type="syntaxhighlighter"><![CDATA[   &lt;input 
id=&quot;firstName_12a820cc40e&quot; name=&quot;firstName&quot; 
type=&quot;text&quot;&gt;
 ]]></script>
-</div></div><p>What's happening here is that Tapestry is working to prevent 
unwanted id clashes as part of the page update. In an HTML document, each 
<code>id</code> is expected to be unique; most JavaScript is keyed off of the 
<code>id</code> field, for instance.</p><p>In a full page render, components 
don't just use their component id (<code>t:id</code>) as their client id; 
instead they use the <code>JavaScriptSupport</code> environmental to allocate a 
unique id. When there's no loops or conflicts, the client id matches the 
component id.</p><p>When the component is inside a loop, a suffix is appended: 
<code>firstName</code>, <code>firstName_0</code>, <code>firstName_1</code>, 
etc.</p><p>When the component is rendered as part of an Ajax partial page 
update, the rules are different. Since Tapestry doesn't know what content has 
been rendered onto the page previously, it can't use its normal tricks to 
ensure that ids are unique.</p><p>Instead, Tapestry creates a random-ish unique 
id s
 uffix, such as "12a820cc40e" in the example; this suffix is appended to all 
allocated ids to ensure that they do not conflict with previously rendered 
ids.</p><h3 
id="AjaxComponentsFAQ-WhydoIsometimesgettheexception&quot;Therenderedcontentdidnotincludeanyelementsthatallowforthepositioningofthehiddenformfield'selement.&quot;whenrenderinganemptyZone?">Why
 do I sometimes get the exception "The rendered content did not include any 
elements that allow for the positioning of the hidden form field's element." 
when rendering an empty Zone?</h3><p>As part of Tapestry's form processing, it 
must write a hidden input element with information needed when the form is 
submitted. Since the content of a Zone may be changed or removed, a hidden 
field is created just for the Zone, separate from the rest of the enclosing 
form.</p><p>At the same time, Tapestry wants to position the &lt;input&gt; 
field in a valid location, and HTML defines some constraints for that; an input 
field must appear inside a &l
 t;p&gt; or &lt;div&gt; element. In your empty Zone, there's no place to put 
the hidden element.</p><p>The solution is to add the following to the body of 
your Zone:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" 
type="syntaxhighlighter"><![CDATA[&lt;div class=&quot;t-invisible&quot;/&gt;
-]]></script>
-</div></div><p>This ensures that there's a place for the hidden input field. 
The "t-invisible" CSS class ensures that the &lt;div&gt; does not display or 
otherwise affect layout.</p><style type="text/css">/*<![CDATA[*/
+</div></div><p>What's happening here is that Tapestry is working to prevent 
unwanted id clashes as part of the page update. In an HTML document, each 
<code>id</code> is expected to be unique; most JavaScript is keyed off of the 
<code>id</code> field, for instance.</p><p>In a full page render, components 
don't just use their component id (<code>t:id</code>) as their client id; 
instead they use the <code>JavaScriptSupport</code> environmental to allocate a 
unique id. When there's no loops or conflicts, the client id matches the 
component id.</p><p>When the component is inside a loop, a suffix is appended: 
<code>firstName</code>, <code>firstName_0</code>, <code>firstName_1</code>, 
etc.</p><p>When the component is rendered as part of an Ajax partial page 
update, the rules are different. Since Tapestry doesn't know what content has 
been rendered onto the page previously, it can't use its normal tricks to 
ensure that ids are unique.</p><p>Instead, Tapestry creates a random-ish unique 
id s
 uffix, such as "12a820cc40e" in the example; this suffix is appended to all 
allocated ids to ensure that they do not conflict with previously rendered 
ids.</p><h3 
id="AjaxComponentsFAQ-WhydoIsometimesgettheexception&quot;Therenderedcontentdidnotincludeanyelementsthatallowforthepositioningofthehiddenformfield'selement.&quot;whenrenderinganemptyZone?">Why
 do I sometimes get the exception "The rendered content did not include any 
elements that allow for the positioning of the hidden form field's element." 
when rendering an empty Zone?</h3><p>As part of Tapestry's form processing, it 
must write a hidden input element with information needed when the form is 
submitted. Since the content of a Zone may be changed or removed, a hidden 
field is created just for the Zone, separate from the rest of the enclosing 
form.</p><p>At the same time, Tapestry wants to position the &lt;input&gt; 
field in a valid location, and HTML defines some constraints for that; an input 
field must appear inside a &l
 t;p&gt; or &lt;div&gt; element. In your empty Zone, there's no place to put 
the hidden element.</p><p>The solution is to add a &lt;div&gt; element to the 
body of the zone; t<span style="line-height: 1.4285715;">his ensures that 
there's a place for the hidden input field. &#160;An empty &lt;div&gt; element 
(even one containing a hidden form field) will not affect page 
layout.</span></p><style type="text/css">/*<![CDATA[*/
 table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 
3px;margin: 0px;background-color: #f0f0f0}
 table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 
16px;border: none;}
 table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}

Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.


Reply via email to