[Using an even latest beta]
You'll also get a javascript error:
'ev.preventDefault is not a function'
if your form doesn't use validators.
Anyway, I think both these errors are correct, since the function
is defined as:
postpageFormForm = function(event) {...}
and this in postpageFormForm(this) refers to the
button control, not to an event.
So, you can create an event object and pass it to that function...
or connect the function using dojo
dojo.event.connect(window, "onload", function(e) {
dojo.event.connect(dojo.byId("mySubmitButton"), "onclick", document,
"postpageFormForm");
});
or use something like:
<span jwcid="[EMAIL PROTECTED]:AjaxEventSubmit"
updateComponents="ognl:{'errorMessagePane'}"/>
<input jwcid="@Submit" value="Javascript Submit"
eventListener="onclick=components.onClickSubmit"/>
>From "Harvey, David " <[EMAIL PROTECTED]>:
> Hello all, I've run in to a problem with Tapestry/Tacos. I'm using
> Tapestry 4.0.1 and a nightly of tacos4-beta-3:
> tacos4-beta-3-20060509-1708-lib.
>
> The form is a tacos:AjaxForm. I have a standard Tapestry Submit
> component that posts the form with the onclick="javascript: return
> postpageFormForm(this)" where the name of the form is 'pageForm'.
>
> The problem is when we click the button we get a javascript error in the
> firefox debugger 'setting a property that only has a getter' in the line
> flagged below. This script is at net/sf/tacos/ajax/componets/Form.js.
>
> Does anybody have an idea what the problem is?
>
> Thanks in advance.
>
>
> //
> // Bypasses normal form event listeners so that the forms default
> // event handling mechanisms aren't brutalized by setting event=..
> //
> // eventType - Type of javascrtipt event (onsubmit/onrefresh/etc..)
> // formId - Element id of form
> // handler - Javascript method reference, takes in an event object
> // that we will manipulate here
> // advice - Where to add listener, either before or after specified
> event.
> // If not specified the default is after
> Tapestry.registerListener = function(eventType, formId, handler, advice)
> {
> if (!advice) advice = "after";
> var form = dojo.byId(formId);
> if (!form) return;
>
> var newFunc = new Object();
> newFunc.applyFormEvent = function(event) {
> if (typeof event.invalid_field_handler == "undefined") {
> //Here we add behaviour not normally on event
> event.form = form; <--- THIS IS THE LINE
> THAT CAUSES THE EXCEPTION
> event.abort = false;
> event.cancel_handlers = false;
> event.invalid_field_handler =
> Tapestry.default_invalid_field_handler;
> event.invalid_field = function(field, message) {
> event.invalid_field_handler.call(window,
> event, field, message);
> };
>
> event.toString = function() {
> return "TacosFormSubmitEvent["
> + this.form.name + " "
> + this.type + " "
> + this.abort + "]";
> };
> }
> dojo.debug("Calling form handler");
> handler.call(window, event);
> }
> dojo.event.connect(advice, form,
> eventType, newFunc,
> "applyFormEvent");
>
> tacos.addFormHandler(formId, function(e) {
> newFunc.applyFormEvent(e); });
> }
>
>
> "Secure Server BSK" made the following
> annotations on 07/10/2006 03:44:47 PM
> ------------------------------"This e-mail, including attachments, may
> include confidential and/or proprietary information, and may be used only by
> the person or entity to which it is addressed. If the reader of this e-mail
> is not the intended recipient or his or her authorized agent, the reader is
> hereby notified that any dissemination, distribution or copying of this
> e-mail is prohibited. If you have received this e-mail in error, please
> notify the sender by replying to this message and delete this e-mail
> immediately."
> ==============================
--
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel