Saturday, 31 August 2013

Application Exception in tapestry subforms - Parameter is bound to null

Application Exception in tapestry subforms - Parameter is bound to null

I want to create a subform with tapestry5:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<t:TextField t:id="name" />
</html>
and use it like this:
<form t:type="form" t:id="testForm">
<t:testComponent name="name" />
<input type="submit"/>
</form>
TestComponent.java:
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
public class TestComponent {
@Parameter(required = true, allowNull = false)
@Property
private String name;
}
so that i can use the value of 'name' like:
@Property
private String name;
void onSuccessFromTestForm() {
System.out.println(name);
}
But all i get is an application exception:
Render queue error in BeginRender[Index:testcomponent.name]: Failure
reading parameter 'value' of component Index:testcomponent.name: Parameter
'name' of component Index:testcomponent is bound to null. This parameter
is not allowed to be null.
Whats the problem?

No comments:

Post a Comment