The event listener method has to return the component or block that you want to render inside the block. If the method returns nothing like your example than the whole contents of the zone will be empty, like you say.

That's just how the zone works, it renders the returned component/block and places the rendered content inside the zone tag replacing the existing content.

Toby Hobson wrote:
Can anyone see anything wrong with my code?

        <t:zone t:id="formzone">
            <h3>
                <t:form t:id="form" style="display:inline"
t:zone="formzone">
                    <strong>Public:</strong>
                    <t:if test="gallery.publicGallery">
                        <input type="image"
src="${asset:context:images/green_tick.png}" alt="yes"
style="vertical-align:middle;padding-left:5px" />
                    </t:if>
                    <t:unless test="gallery.publicGallery">
                        <input type="image"
src="${asset:context:images/red_cross.png}" alt="no"
style="vertical-align:middle;padding-left:5px" />
                    </t:unless>
                </t:form>
            </h3>
        </t:zone>

    void onSuccess() {
        gallery.setPublicGallery(! gallery.isPublicGallery());
        galleryService.update(gallery);
    }

Basically i display a tick if the gallery.publicGallery is true and a cross
if it's false. Clicking on the tick/cross changes the state. This works fine
using a conventional submit but adding the ajax stuff just gives me an empty
div when the form is submitted

I'm sure it's something simple i've missed

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to