Issue Details (XML | Word | Printable)

Key: TAPESTRY-2360
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Howard M. Lewis Ship
Reporter: Adriaan Joubert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Tapestry

Forms in zones in loops have wrong zone id after update

Created: 16/Apr/08 09:29 AM   Updated: 08/Jun/08 08:36 PM
Return to search
Component/s: tapestry-core
Affects Version/s: 5.0.12
Fix Version/s: 5.0.13

Time Tracking:
Not Specified

Resolution Date: 08/Jun/08 08:36 PM


 Description  « Hide
When having a loop with forms in zones as in

<t:loop source="...">
    <t:zone t:id="zone">
        <t:form t:id="f" t:zone="prop:zone.clientid">
            ...
        </t:form>
    </t:zone>
</t:loop>

The form updates the zone correctly on the first submit. The update handler returns the form (this is simpler in my application, as the zone/form is in a separate component) as in

@Component
private Form _f;

Object onSuccess() {
   ....
    return _f;
}

The return value contains the markup + a script to link the form to the zone again. At this point the form does not know what the id was of the original zone, and returns a zone name of the form "zone:<number>". As the zone cannot be found, the whole page is refreshed when submitting the form a second time.

To solve this from the user perspective one possibility to set the client id used for the zone explicitly, but this may cause problems with uniqueness of names.

 Ideally the javascript will return the zone id in the AJAX request, so that it is not necessary to track the zone id in the application. The javascript linking the form to the zone could then use the correct zone id.

Thanks,

Adriaan

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriaan Joubert made changes - 16/Apr/08 09:36 AM
Field Original Value New Value
Description When having a loop with forms in zones as in

<t:loop source="...">
    <t:zone t:id="zone">
        <t:form t:id="f" t:zone="prop:zone.clientid">
            ...
        </t:form>
    </t:zone>
</t:loop>

The form updates the zone correctly on the first submit. The update handler returns the form (this is simpler in my application, as the zone/form is in a separate component) as in

@Component
private Form _f;

Object onSuccess() {
   ....
    return _f;
}

The return value contains the markup + a script to link the form to the zone again. At this point the form does not know what the id was of the original zone, and returns a zone name of the form "zone:<number>". As the zone cannot be found, the whole page is refreshed when submitting the form a second time.

To solve this from the user perspective it must be possible to set the client id used for the zone explicitly. Ideally (but this will still require the ability to set the zone id explicitly as well) the javascript will return the zone id in the request, so that it is not necessary to track the zone id in the application.

Thanks,

Adriaan
When having a loop with forms in zones as in

<t:loop source="...">
    <t:zone t:id="zone">
        <t:form t:id="f" t:zone="prop:zone.clientid">
            ...
        </t:form>
    </t:zone>
</t:loop>

The form updates the zone correctly on the first submit. The update handler returns the form (this is simpler in my application, as the zone/form is in a separate component) as in

@Component
private Form _f;

Object onSuccess() {
   ....
    return _f;
}

The return value contains the markup + a script to link the form to the zone again. At this point the form does not know what the id was of the original zone, and returns a zone name of the form "zone:<number>". As the zone cannot be found, the whole page is refreshed when submitting the form a second time.

To solve this from the user perspective one possibility to set the client id used for the zone explicitly, but this may cause problems with uniqueness of names.

 Ideally the javascript will return the zone id in the AJAX request, so that it is not necessary to track the zone id in the application. The javascript linking the form to the zone could then use the correct zone id.

Thanks,

Adriaan
Howard M. Lewis Ship made changes - 08/Jun/08 07:27 PM
Assignee Howard M. Lewis Ship [ hlship ]
Howard M. Lewis Ship made changes - 08/Jun/08 07:27 PM
Status Open [ 1 ] In Progress [ 3 ]
Howard M. Lewis Ship added a comment - 08/Jun/08 07:28 PM
I think the right fix here is that if you explicitly specify the zone's id (via the id parameter), it is used exactly as provided.

Repository Revision Date User Message
ASF #664551 Sun Jun 08 20:36:29 UTC 2008 hlship TAPESTRY-2360: Forms in zones in loops have wrong zone id after update
Files Changed
MODIFY /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java

Howard M. Lewis Ship made changes - 08/Jun/08 08:36 PM
Component/s tapestry-core [ 12311285 ]
Component/s XHR/dhtml/Ajax [ 12311531 ]
Howard M. Lewis Ship made changes - 08/Jun/08 08:36 PM
Resolution Fixed [ 1 ]
Fix Version/s 5.0.13 [ 12313205 ]
Status In Progress [ 3 ] Closed [ 6 ]