Hi all
I'm afraid I've another newB question...
My point is quite simple : I would a field of my form to be required.
I've done the following :
Test.html :
<html>
<head><title>Test</title></head>
<body jwcid="@Body">
<form jwcid="inscriptionForm" >
<table style="text-align: left; width: 100%;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td width="200"><label>Login :</label></td>
<td><input jwcid="login" type="text" /></td>
</tr>
<tr>
<td><input value="OK" type="submit" /></td>
</tr>
</tbody>
</table>
</form>
<a jwcid="@PageLink" page="Home">go to Page1</a>
</body>
</html>
Test.page:
<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<page-specification class="test.Test">
<asset name="entete" path="/images/right.gif"/>
<property name="login"/>
<component id="login" type="TextField">
<binding name="value" value="login"/>
<binding name="validators" value="validators:required"/>
</component>
<component id="inscriptionForm" type="Form">
<binding name="listener" value="listener:onOk"/>
</component>
</page-specification>
Test.class :
package test;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;
public abstract class Test extends BasePage {
public abstract String getLogin();
public String onOk(IRequestCycle cycle) {
System.out.println("Login: " + getLogin());
return "Home";
}
}
When I enter no value, I'm sent to the Home page,there's no validation error
appearing... Where am I wrong ?
Thanks in advance
ZedroS