I have problem with onValidate method. what's happens!? When I submit form,
onValidate method invoked, but it happens nothing. Operation continue to run
and tapestry report an error. When i do backward in my browser and refresh
page i have got desired results, my customize information message.
Code:
- tml:
<t:beaneditform t:id="izmenaKupca" object="telefonKupca"
exclude="brojTelefona" add="ime, prezime, adresa"
submitlabel="message:create/updateiz">
<t:parameter name="ime">
<t:label t:for="ime">Ime Kupca</t:label>
<t:textfield t:value="telefonKupca.kupac.ime" t:id="ime3"/>
</t:parameter>
<t:parameter name="prezime">
<t:label t:for="prezime"/>
<t:textfield t:value="telefonKupca.kupac.prezime"
t:id="prezime3"/>
</t:parameter>
<t:parameter name="adresa">
<t:label t:for="adresa"/>
<t:textfield t:value="telefonKupca.kupac.adresa"
t:id="adresa3"/>
</t:parameter>
</t:beaneditform>
- java:
void onValidateFromTelefonKupca() throws ValidationException
{
Telefonkupca tk = (Telefonkupca) service.find(Telefonkupca.class,
telefonKupca.getBrojTelefona());
if(tk!=null){
throw new ValidationException("Vec postoji");
}
}
.
.
.
Object onSubmitFromTelefonKupca(){
service.persist(telefonKupca);
return index;
}
In this example I want to get message when try to insert customer who
already exists in database. But when i try to insert cusomer with id thats
already exist, tapestry report error "Duplicate entry '0653235453' for key
'PRIMARY'".... I think that validation system will stop execution of
operation... Can somebody explain me where is error?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/onValidate-behave-strange-tp5587786p5587786.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]