You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andrew Ingram <an...@titanemail.com> on 2007/05/30 14:58:00 UTC

Re: Tapestry 3 and Valid XHTML Forms (generated Script tag)

Thanks Jonathan,

I'm down to just one tapestry-generated validation error now.

I'm still getting the language attribute on script tags (example below), 
i've looked through the tapestry source and the scripting stuff seems a 
bit complicated, even if I tell the component to not use client side 
scripting it still generates a small amount of script (used for focusing 
the text input).

I'm interested in knowing two things:
1) Where in tapestry is the script tag written and how can I overwrite 
it to not use the language attribute?
2) Can I make a validfield generate no javascript whatsoever?

Example output:

<script language="JavaScript" type="text/javascript" src="/app?service=asset&amp;sp=S%2Forg%2Fapache%2Ftapestry%2Fvalid%2FValidator.js&amp;sp=S3dfc7ba91240b3bbd49fbb3ccccefe31"></script>
<script language="JavaScript" type="text/javascript"><!--


function validate_SearchField()
{
  var field = document.Form0.SearchField;

  if (field.value.length == 0)
     return validator_invalid_field(field, "You must enter a value for the search to work...");


  if (field.value.length < 1)
     return validator_invalid_field(field, "You must enter at least 1 characters for the search to work...");

  return true;
}


window.onload = function ()
{
document.Form0.SearchField.focus();
document.Form0.SearchField.select();
document.Form0.onsubmit = validate_SearchField;
}


Regards,
Andrew Ingram



Jonathan O'Connor wrote:
>
> Andrew,
> you will have to roll your own components. The ImageSubmit component 
> should be fairly easy. Just copy the source for the ImageSubmit 
> component, and then alter the code to avoid outputing a border 
> attribute. You can probably also extend from ImageSubmit, and change 
> the rendering.
>
> You should be able to do the same with the Form class too.
>
> Sorry I can't be more explicit, but its over a year since I did any 
> Tapestry work (all Tap3).
> Good luck,
> Jonathan O'Connor
> XCOM Dublin
>


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 3 and Valid XHTML Forms (generated Script tag)

Posted by Jonathan O'Connor <jo...@xcom.de>.
Andrew,
sorry I can't help you on that. I guess get out and grep for script. Try
putting a breakpoint on the rendering methods, and see what happens.
Ciao,
Jonathan O'Connor
XCOM Dublin


                                                                           
             Andrew Ingram                                                 
             <andrew.ingram@ti                                             
             tanemail.com>                                              To 
                                       Tapestry users                      
             30.05.2007 13:58          <us...@tapestry.apache.org>         
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             "Tapestry users"          Re: Tapestry 3 and Valid XHTML      
             <users@tapestry.a         Forms (generated Script tag)        
                pache.org>                                                 
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Thanks Jonathan,

I'm down to just one tapestry-generated validation error now.

I'm still getting the language attribute on script tags (example below),
i've looked through the tapestry source and the scripting stuff seems a
bit complicated, even if I tell the component to not use client side
scripting it still generates a small amount of script (used for focusing
the text input).

I'm interested in knowing two things:
1) Where in tapestry is the script tag written and how can I overwrite
it to not use the language attribute?
2) Can I make a validfield generate no javascript whatsoever?

Example output:

<script language="JavaScript" type="text/javascript"
src="/app?service=asset&amp;sp=S%2Forg%2Fapache%2Ftapestry%2Fvalid%2FValidator.js&amp;sp=S3dfc7ba91240b3bbd49fbb3ccccefe31"></script>

<script language="JavaScript" type="text/javascript"><!--


function
validate_SearchField()
{
  var field = document.Form0.SearchField;

  if
(field.value.length == 0)
     return validator_invalid_field(field, "You
must enter a value for the search to work...");


  if (field.value.length <
1)
     return validator_invalid_field(field, "You must enter at least 1
characters for the search to work...");

  return true;
}


window.onload =
function ()
{
document.Form0.SearchField.focus();
document.Form0.SearchField.select();
document.Form0.onsubmit =
validate_SearchField;
}


Regards,
Andrew Ingram



Jonathan O'Connor wrote:
>
>
Andrew,
> you will have to roll your own components. The ImageSubmit
component 
> should be fairly easy. Just copy the source for the ImageSubmit
> component, and then alter the code to avoid outputing a border 
>
attribute. You can probably also extend from ImageSubmit, and change 
> the
rendering.
>
> You should be able to do the same with the Form class too.
>
>
Sorry I can't be more explicit, but its over a year since I did any 
>
Tapestry work (all Tap3).
> Good luck,
> Jonathan O'Connor
> XCOM Dublin
>
______________________________________________________________________
This
email has been scanned by the MessageLabs Email Security System.
For more
information please visit http://www.messagelabs.com/email
______________________________________________________________________
---------------------------------------------------------------------
To
unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional
commands, e-mail: users-help@tapestry.apache.org




*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein
für den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist
das Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten,
eine fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns
eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use
of the intended recipient. Any review, distribution by others or forwarding
without express permission is strictly prohibited. If you are not the
intended recipient, please contact the sender and delete all copies.

Hauptsitz: Bahnstrasse 37, D-47877 Willich, USt-IdNr.: DE 812 885 664
Kommunikation: Telefon +49 2154 9209-70, Telefax +49 2154 9209-900,
www.xcom.de
Handelsregister: Amtsgericht Krefeld, HRB 10340
Vorstand: Matthias Albrecht, Renate Becker-Grope, Marco Marty, Dr. Rainer
Fuchs
Vorsitzender des Aufsichtsrates: Stephan Steuer