You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "seloha ." <se...@hotmail.com> on 2005/09/15 18:48:32 UTC
tap 4 beta 6 clientValidationEnabled doe not seem to work
I am using tap 4 beta 6 and have a form with client side javascript enabled:
<form jwcid="form@Form" listener="ognl:listeners.formSubmit"
delegate="ognl:beans.delegate" clientValidationEnabled="true">
also in the form is a field for validation:
<span jwcid="@PropertySelection" model="ognl:someModel"
value="ognl:someValue" displayName="Some Value"
validators="validators:required"/>
and to submit the form:
<input type="submit" jwcid="@Submit" value="Something"
selected="ognl:whichButton" tag="literal:add" onclick="return
window.confirm('Are you sure?');"/>
The client-side validation is never fired but the server-side validation
works fine, using:
IValidationDelegate validationDelegate = (IValidationDelegate)
getBeans().getBean("delegate");
if (validationDelegate.getHasErrors()) {
return;
}
I know I have not put all the detail but hopefully enough. Any ideas?
Also what is the way on running using the client-side validation scripting
within your own javascripts before doing your own further javascript
validation.
Thanks inadvance,
Paul
p.s. the browser is Firefox (Mozilla). I have tried on os x and windows
platforms with no success. The above code is an example and may not be
exactly correct. I think my problem is that I am missing something
fundamental. I have had similar code working correctly in tap 3.0.3.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: tap 4 beta 6 clientValidationEnabled doe not seem to work
Posted by "seloha ." <se...@hotmail.com>.
Further investigation shows that tapestry page enhancement includes:
<script type="text/javascript"
src="/tair/app?digest=b4909c59529064c46eb8843b65911500&path=%2Forg%2Fapache%2Ftapestry%2Fform%2FForm.js&service=asset"></script>
and at the foot of the page:
<script language="JavaScript" type="text/javascript"><!--
Tapestry.register_form('form');
Tapestry.onsubmit('form', function(event) { Tapestry.require_field(event,
'holidayDay', 'You must enter a value for Holiday Day.'); });
Tapestry.onsubmit('form', function(event) { Tapestry.require_field(event,
'holidayMonth', 'You must enter a value for Holiday Month.'); });
Tapestry.set_focus('holidayDay');
// --></script>
relevant to scripting. I presumabe someone has got client side validation
working. All the relevant enhancements to the page to enable javascript
validation to work appear to be there but nothing happens. No javascript
errors are thrown when the form is submitted. Any ideas?
Paul
seloha . <se...@hotmail.com> write:
I am using tap 4 beta 6 and have a form with client side javascript enabled:
<form jwcid="form@Form" listener="ognl:listeners.formSubmit"
delegate="ognl:beans.delegate" clientValidationEnabled="true">
also in the form is a field for validation:
<span jwcid="@PropertySelection" model="ognl:someModel"
value="ognl:someValue" displayName="Some Value"
validators="validators:required"/>
and to submit the form:
<input type="submit" jwcid="@Submit" value="Something"
selected="ognl:whichButton" tag="literal:add" onclick="return
window.confirm('Are you sure?');"/>
The client-side validation is never fired but the server-side validation
works fine, using:
IValidationDelegate validationDelegate = (IValidationDelegate)
getBeans().getBean("delegate");
if (validationDelegate.getHasErrors()) {
return;
}
I know I have not put all the detail but hopefully enough. Any ideas?
Also what is the way on running using the client-side validation scripting
within your own javascripts before doing your own further javascript
validation.
Thanks inadvance,
Paul
p.s. the browser is Firefox (Mozilla). I have tried on os x and windows
platforms with no success. The above code is an example and may not be
exactly correct. I think my problem is that I am missing something
fundamental. I have had similar code working correctly in tap 3.0.3.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org