Re: WO and Javascript
Re: WO and Javascript
- Subject: Re: WO and Javascript
- From: Wolfram Stebel <email@hidden>
- Date: Tue, 29 Nov 2005 19:40:18 +0100
- Thread-topic: WO and Javascript
Am 29.11.2005 17:58 Uhr schrieb "Joseph Leo Moreno" unter
<email@hidden>:
Thanks for your input.
Thats what i'm gonna do, well, trying to do...
Instead of "alert" i need a "confirm" for the decision.
depending on the return value on the client side i need either the
clientside decision to submit or not, or on the clientside any binding set
to the result of the confirm so that i can discontinue deleting data.
Sounds easy.. but i'm missing the details.
Wolfram
P.S. To submit or not to submit, thats the question... :-)
P.P.S. Well: i submit, therefore i am :-))
P.P.P.S. Cogito, ergo submittum
> Wolfram,
>
> I realize that I'm probably oversimplifying your problem here. But,
> couldn't you just bind a JavaScript alert function to your Delete
> button (client side) and bind your Delete button to your delete
> action (sever side). When the user clicks on the Delete button, the
> JavaScript alert pops up. If the User clicks Yes, the server side
> Delete action is called. If the user clicks No then nothing happens -
> hence, the Delete action isn't called.
>
> Would that solutions solve your problem?
>
> - Joe
>
> On Nov 29, 2005, at 07:42, Wolfram Stebel wrote:
>
>> 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? :-)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden