Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WO and Javascript



Hi list,

after searching and testing a lot, i finaly have to ask:

I have normal WOComponents using submit buttons for saving data etc.
I want to validate via javascript that the user is sure to DELETE data.
For this i created a javascript funtion that is bound to a delete buttons
"onclick".
So far OK. But now i need the value of the confirm ( "are you sure?" )
inside my WOComponent.
I tried several thousand permutations of bindings, code etc.
At the moment i have a variable "confirmed" in my component.
I bound it to a hidden WOTextField with ID "confirmed" and try to get the
value with

    aVar = this.document.Form1.getElementID("confirmed").value;

where Form1 is a binding "name" i attached to my WOForm.
It does not seem to execute this code correct, i do not reach another alert
("did it") after this code.

At last i wont to return the value with:

    if ( check )
        this.document.Form1.getElementById("confirmed").value = "true";
    else
        this.document.Form1.getElementById("confirmed").value = "false";

which doesnt work either.

I expected the binding "confirmed" to be synchronized on the way back to the
server.

Any straight receipes how to return values from javascripts into a
component?

One thing i found searching the web is, that Chuck has a chapter on
javascript in his next book. Should i wait for it? :-)


TIA

Wolfram


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.