Hi Howard!

Thanks for the reply.

I installed Firebug, but there was no errors. I also cleaned all personal
data (cookies, data from forms ...) but it still not works! An interesting
thing that I could note, looking at the generated source code, is that there
is no javascript inside my page. Obviously, that is the reason because the
client-side validation is not working. But, I cannot understand why the
scripts are not sent.

By the way, here is the source code of the border component:

<pre>
<HTML xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
<HEAD>
<TITLE>Questões de TI - ${tituloPagina}</TITLE>
<meta content="MSHTML 6.00.6000.16705" name="GENERATOR" />
<META http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<LINK href="${asset:context:/styles/main.css}" type="text/css"
        rel="stylesheet" />
<LINK href="${asset:context:/styles/styles.css}" type="text/css"
        rel="stylesheet" />
</HEAD>
<BODY>
<DIV class="box" id="main">
<DIV id="header">
<H1 id="logo">Questões de TI</H1>
<HR class="noscreen" />
</DIV>
<!-- header --> <!-- Main menu (tabs) -->
<DIV class="noprint" id="tabs">
<UL class="box">
        <LI> # Cargos </LI>
        <LI> # Organizadoras </LI>
        <LI> # Orgãos do Governo </LI>
        <LI> # Provas </LI>
        <LI> # Subtemas </LI>
        <LI> # Temas </LI>
        <LI> # Tipos de Questão </LI>           
</UL>
<HR class="noscreen" />
</DIV>
<!-- /tabs -->
<DIV class="box" id="page">
<DIV class="box noprint" id="strip"><!-- Breadcrumbs -->
<P id="breadcrumbs">Voce está aqui:  # Página Inicial </P>
<HR class="noscreen" />
</DIV>
<!-- /strip -->
<DIV id="content">

<t:body /> <!-- content --></DIV>

</DIV>
<!-- page -->

<DIV id="footer">
<P align="center">Questões de TI - 2008</P>
</DIV>

</DIV>
</BODY>
</HTML>
</pre>

Thanks again!


Howard Lewis Ship wrote:
> 
> It should work. Try it in Firefox with Firebug installed, check to see
> if there are any errors. Trying using Shift-F5 to force a reload of
> the page (this ensures that fresh copies of files are retrieved from
> the server, rather than cached copies).  View the source and check
> that the validation JavaScript is included at the bottom of the page.
> Also make sure your Border component includes an <html> and <body>
> element ... if either is missing, no JavaScript is sent to the client.
> 
> On Sat, Oct 25, 2008 at 9:17 AM, andrethiago <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi all!
>>
>> I'm using Tapestry 5.0.15, and I'm having some problems with validate (on
>> client side) a required text field in my forms. Basically, the validation
>> "bubble" does not appear for me. Let's show my codes.
>>
>> First, I have an entity, called Organizadora. Here's is the code:
>>
>> public class Organizadora implements Serializable {
>>
>>        private static final long serialVersionUID = 1L;
>>        // primary key
>>        private Integer id;
>>        // other fields
>>        private String nome;
>>        private String sigla;
>>        private Set<Prova> provas;
>>        private String url;
>>
>>        public Organizadora() {
>>        }
>>
>>        public Integer getId() {
>>                return id;
>>        }
>>
>>        public void setId(Integer id) {
>>                this.id = id;
>>        }
>>
>>        public String getNome() {
>>                return nome;
>>        }
>>
>>        public void setNome(String nome) {
>>                this.nome = nome;
>>        }
>>
>>        public String getSigla() {
>>                return sigla;
>>        }
>>
>>        public void setSigla(String sigla) {
>>                this.sigla = sigla;
>>        }
>>
>>        public Set<Prova> getProvas() {
>>                return provas;
>>        }
>>
>>        public void setProvas(Set<Prova> provas) {
>>                this.provas = provas;
>>        }
>>
>>        public String getUrl() {
>>                return url;
>>        }
>>
>>        public void setUrl(String url) {
>>                this.url = url;
>>        }
>>
>>        public void adicionaProva(Prova prova) {
>>                if (this.provas == null) {
>>                        this.provas = new HashSet<Prova>();
>>                }
>>                prova.setOrganizadora(this);
>>                this.provas.add(prova);
>>        }
>>
>>        @Override
>>        public boolean equals(Object obj) {
>>                return super.equals(obj);
>>        }
>>
>>        @Override
>>        public int hashCode() {
>>                return super.hashCode();
>>        }
>>
>>        @Override
>>        public String toString() {
>>                return super.toString();
>>        }
>>
>> }
>>
>> Then, I have a page that contains a form to save a new entity. Here's the
>> .tml:
>>
>> <t:border t:tituloPagina="Include Organizadora"
>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>>        <H3>Include Organizadora</H3>
>>        <t:form t:id="form">
>>                <fieldset>
>>                <TABLE cellSpacing="1" cellPadding="0" border="0">
>>                        <TBODY>
>>                                <TR>
>>                                        <TD><STRONG>Nome:</STRONG></TD>
>>                                        <TD><t:textfield t:id="nome"
>> t:value="organizadora.nome"
>> t:validate="required" size="80"/></TD>
>>                                </TR>
>>                                <TR>
>>                                        <TD><STRONG>Url:</STRONG></TD>
>>                                        <TD><t:textfield size="80"
>> t:id="url"
>>                                                t:value="organizadora.url"
>> /></TD>
>>                                </TR>
>>                                <TR>
>>                                        <TD><STRONG>Sigla:</STRONG></TD>
>>                                        <TD><t:textfield size="40"
>> t:id="sigla"
>>                                               
>> t:value="organizadora.sigla" /></TD>
>>                                </TR>
>>                        </TBODY>
>>                </TABLE>
>>                </fieldset>
>>                <div align="right">
>>                        <INPUT t:type="submit" type="submit"
>> value="Include" />
>>                </div>
>>        </t:form>
>>        <div align="center">
>>         Back to the Organizadora's list.
>>        </div>
>>
>> </t:border>
>>
>> As you can note, the text field nome is marked as required.
>>
>> And, finally, here is the class for this .tml:
>>
>> package br.com.tiquestoes.pages;
>>
>> import org.apache.tapestry5.annotations.InjectPage;
>> import org.apache.tapestry5.annotations.Property;
>> import org.apache.tapestry5.ioc.annotations.Inject;
>>
>> import br.com.tiquestoes.dao.OrganizadoraDAO;
>> import br.com.tiquestoes.dominio.Organizadora;
>>
>> /**
>>  * @author André Thiago
>>  *
>>  */
>> public class PaginaIncluirOrganizadora {
>>
>>        @Property
>>        private Organizadora organizadora;
>>
>>        @Inject
>>        private OrganizadoraDAO organizadoraDAO;
>>
>>        @InjectPage
>>        private PaginaListaOrganizadoras paginaLista;
>>
>>        private Integer id;
>>
>>        public void onActivate(Integer id){
>>                this.id = id;
>>                organizadora = new Organizadora();
>>    }
>>
>>        public Object onPassivate() {
>>                return id;
>>        }
>>
>>        Object onSubmitFromForm() {
>>                organizadoraDAO.inserirOrganizadora(organizadora);
>>                paginaLista.setMensagemSucesso("Entity was included
>> successfully.");
>>
>>                return paginaLista;
>>        }
>>
>> }
>>
>> But, as I said, when I click in the submit button, the client-side
>> validation is not performed.
>>
>> Did I forget anything?
>>
>> André Thiago
>> --
>> View this message in context:
>> http://www.nabble.com/Tapestry-5-Problems-with-client-side-validation-tp20165551p20165551.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]
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Problems-with-client-side-validation-tp20165551p20166508.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]

Reply via email to