Just added an FAQ for this. 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? 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.
At the same time, Tapestry wants to position the <input> field in a valid location, and HTML defines some constraints for that; an input field must appear inside a <p> or <div> element. In your empty Zone, there's no place to put the hidden element. The solution is to add the following to the body of your Zone: <div class="t-invisible"/> This ensures that there's a place for the hidden input field. The "t-invisible" CSS class ensures that the <div> does not display or otherwise affect layout. On Tue, Jul 5, 2011 at 9:09 AM, Tony Nelson <tnel...@starpoint.com> wrote: > Still trying to build what I thought would be a simple component. > > My main tml looks like this: > > <form> > [ input fields] > <t:mycomponent> > </form> > > My component is very simple at the moment: > > <t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" > xmlns:p="tapestry:parameter"> > > <fieldset> > <legend>Email Aliases</legend> > > <t:zone t:id="aliasZone" id="aliasZone"> > <ul> > <li t:type="loop" source="allAliases" value="emailAlias"> > ${emailAlias.alias} > </li> > </ul> > </t:zone> > > <p> > <t:textfield t:id="newAliasField" value="newAlias"/> > <t:actionlink t:id="addAlias" t:zone="aliasZone">Add > Alias</t:actionlink> > </p> > > </fieldset> > > </t:container> > > Any time I render the form, and the loop evaluates to an empty list, I get > the following exception: > > Render queue error in AfterRender[emailuser/Edit:emailaliaseditor.aliaszone]: > The rendered content did not include any elements that allow for the > positioning of the hidden form field's element. > > It works just fine if the loop generates some output. Is tap trying to > optimize the html and remove the useless ul? > > Added a useless hidden div seems to work around this problem. > > <t:zone t:id="aliasZone" id="aliasZone"> > <t:hidden name="useless" value="literal:useless" /> > <ul> > <li t:type="loop" source="allAliases" value="emailAlias"> > ${emailAlias.alias} > </li> > </ul> > </t:zone> > > > Although I'm guessing when I submit the form I'm going to run into a problem. > > Any other suggestions? > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org