I don't think your validate method was ever called because it refers to a
component t:id (telefonKupca) which doesn't exist. Have you tried
onValidateFromIzmenaKupca?
On Thu, 22 Mar 2012 18:04:17 -0300, poletn23 <imlekp...@gmail.com> wrote:
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: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org