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 field in a
valid location, and HTML defines some constraints for that; an input
field must appear inside a or 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:
This ensures that there's a place for the hidden input field. The
"t-invisible" CSS class ensures that the does not display or
otherwise affect layout.
On Tue, Jul 5, 2011 at 9:09 AM, Tony Nelson wrote:
> Still trying to build what I thought would be a simple component.
>
> My main tml looks like this:
>
>
> [ input fields]
>
>
>
> My component is very simple at the moment:
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
> xmlns:p="tapestry:parameter">
>
>
> Email Aliases
>
>
>
>
> ${emailAlias.alias}
>
>
>
>
>
>
> Add
> Alias
>
>
>
>
>
>
> 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.
>
>
>
>
>
> ${emailAlias.alias}
>
>
>
>
>
> 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