I can’t remember all the problems I had when combining FormFragment with Loop 
with modals, but I do know that I solved them all by moving the FormFragment to 
above the loop, adding an If, putting the modal inside it and, on submit of the 
modal, the server-side updated the relevant loop item’s values. This allowed it 
to handle create, update, and delete of loop items.

Admittedly this is with T5.4, but I don’t expect that to make much difference.

For example, here’s a snippet. It’s from a component that I’ll call 
ThingsEditor.

<t:content>

        <t:formfragment visible="isFunction('add_thing')">
                <t:if test="isFunction('add_thing')">
                        <t:BasicInFormModal t:id="addThingModal" 
backdrop="'static'">
                                <t:program.summary.ThingAddEditor 
t:id="addThing" parentId=“parentId" 
                                        thingModels=“thingModels" 
addThingModel="addThingModel"/>
                        </t:BasicInFormModal>
                </t:if>
        </t:formfragment>

        <t:formfragment visible="isFunction('chg_thing')">
                <t:if test="isFunction('chg_thing')">
                        <t:BasicInFormModal t:id="chgThingModal" 
backdrop="'static'">
                                <t:program.summary.ThingChgEditor 
t:id="chgThing" parentId="parentId" 
                                        thingModel="chgThingModel"/>
                        </t:BasicInFormModal>
                </t:if>
        </t:formfragment>

        <t:loop t:source=“thingModels" t:value=“thingModel" 
encoder=“thingModelEncoder”>
                ...
                <t:submit t:id="toChgThing" mode="cancel" 
context=“thingModel.thingDefId" defer="false" value="${extras}" />
                ...
                <t:submit t:id="rmvThing" t:mixins="clickonce" mode="cancel" 
context=“thingModel.thingDefId" defer="false"/>
                ...
        </t:loop>

        <t:linksubmit t:id="toAddThing" 
mode="cancel"></span>${message:add-label}</t:linksubmit>

</t:content>

Does that help?

Geoff

> On 24 Mar 2016, at 7:25 PM, Hendrik Grewe <hendrik.gr...@b4ckbone.de> wrote:
> 
> Hi Dimitris!
> 
> we are currently running Tapestry 5.3.8.
> An Upgrade to T5.4 is currently not feasible.
> 
> Hendrik
> 
> Am 24.03.2016 um 00:17 schrieb Dimitris Zenios:
>> hendrk what version of tapestry are you using?
>> On 23 Mar 2016 16:00, "Hendrik Grewe" <tapestry-u...@b4ckbone.de> wrote:
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

Reply via email to