Your success event handler should return a block of HTML by returning a
Block or a Tapestry Component.
If you don't return anything, nothing is shown ...
Stephane
Toby Hobson a écrit :
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!