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

Reply via email to