You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stefan Schuetz <st...@wammel.com> on 2014/08/16 10:19:34 UTC
Problems with multiple Beaneditors inside Component
Hi guys,
i have some serious trouble with a custom component.
The component needs to have multiple zones and beaneditors nested and thats the problem.
I can’t get it to work. I’ve tried some variants, without success.
(using 5.4-Beta6)
Where is my mistake? Any clues?
PAGE:
<t:zone t:id="rootZone">
<t:form t:id="rootForm" t:zone="^">
<t:beaneditor t:id=„rootFormBeaneditor“ object=„MyCustomObject"></t:beaneditor>
</t:form>
</t:zone>
COMPONENT - Variant A:
Page renders fine, when updating ChildZone A (returning zoneA.getBody() via eventhandler):
TapestryException: No object of type org.apache.tapestry5.services.FormSupport is available from the Environment
<t:zone t:id="childZone_A">
< t:beaneditor t:id="childForm_A"></t:beaneditor>
</t:zone>
<t:zone t:id="childZone_B">
<t:loop formState="ITERATION">
< t:beaneditor t:id="childForm_B"></t:beaneditor>
</t:loop>
</t:zone>
COMPONENT - Variant B:
Page renders fine, when updating ChildZone B (returning zoneB.getBody() via eventhandler):
TapestryException: No object of type org.apache.tapestry5.services.FormSupport is available from the Environment
<t:zone t:id="childZone_A">
<t:beaneditform t:id="childForm_A"></t:beaneditform>
</t:zone>
<t:zone t:id="childZone_B">
<t:loop formState="ITERATION">
<t:beaneditor t:id="childForm_B"></t:beaneditor>
</t:loop>
</t:zone>
COMPONENT - Variant C:
Page renders fine, updating ChildZone B works, but when reloading the whole page:
TapestryException: Form components may not be placed inside other Form components.
<t:zone t:id="childZone_A">
<t:beaneditform t:id="childForm_A"></t:beaneditform>
</t:zone>
<t:zone t:id="childZone_B">
<t:loop formState="ITERATION">
<t:beaneditform t:id="childForm_B"></t:beaneditform>
</t:loop>
</t:zone>
Best regards,
Stefan
Re: Problems with multiple Beaneditors inside Component
Posted by Lance Java <la...@googlemail.com>.
It's hard to see from your sample code how this all hangs together but I
think you'll need to use the FormInjector component to add dynamic content
to an existing form.