I have a very simple page which uses a form to update one page property
and a zone. Sourcecode and template see below.
It works as expected, the page property and the zone is updated as intended.
But whenever I use a the FormLayoutMixin on the form, "somePageProperty"
won't be updated anymore. The mixin doesn't do very much but render some
html before and some after the form, so I don't understand this odd
behaviour.
I tested this with 5.0.14 and 5.0.15-SNAPSHOT on Windows XP with Jetty 6
and FF3.
Andy
----------------------------------
* page class *
----------------------------------
public class FormZoneUpdate {
@Inject
private Block showResult;
@Property
private String somePageProperty;
/**Tapestry form submit event method. Called if validation is
successful.*/
@Log
public Object onSuccess() {
return showResult;
}
}
----------------------------------
* page template *
----------------------------------
<html t:type="t5c/LeoniLayout"
t:pageTitle="literal:Example: Form Updating Zone "
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<form t:type="Form"
t:autofocus="true"
t:zone="resultZone"
t:mixins="t5c/FormLayoutMixin"
t:layoutMixinTitle="boo">
<tr>
<td class="formFieldLabel" valign="top" align="right">
<t:label for="searchTerm"/>
</td>
<td class="formField">
<input t:type="TextField"
t:value="somePageProperty"
t:id="searchTerm"/>
</td>
</tr>
<tr>
<td class="formButtons" colspan="2">
<input t:type="submit"
t:clientId="Submit"
t:id="submitButton"
value="Submit"/>
</td>
</tr>
</form>
<t:zone t:id="resultZone">
Nothing yet to show.
<t:block id="showResult">
You searched for: ${somePageProperty}
</t:block>
</t:zone>
</html>
----------------------------------
* mixin class *
----------------------------------
@IncludeStylesheet("css/FormLayoutMixin.css")
public class FormLayoutMixin {
/**
* Der Titel des Formulars
*/
@Parameter(required=true, allowNull=false,
defaultPrefix=BindingConstants.LITERAL)
private String layoutMixinTitle;
void beginRender(MarkupWriter writer) {
writer.writeRaw("<table class=\"t5c-form
t5c-oneColumnStyle\"><tr><th>");
writer.writeRaw(getLayoutMixinTitle());
writer.writeRaw("</th></tr><tr><td><table><tr><td>");
}
void afterRender(MarkupWriter writer) {
writer.writeRaw("</td></tr></table></td></tr></table>");
}
/**
* @return the layoutMixinTitle
*/
public String getLayoutMixinTitle() {
return this.layoutMixinTitle;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]