Re: WO and Javascript
Re: WO and Javascript
- Subject: Re: WO and Javascript
- From: Helge Staedtler <email@hidden>
- Date: Tue, 29 Nov 2005 18:55:55 +0100
hmm, javascript and DHTML in WebObjects are my specials. ;-)
though I think that DHTML is some *very* ugly obstruction of technology and
in no way a standard (think about why there exist
ad-popup-window-blocker)... since the AJAX-hype is taking off (roundcube
webmail, google maps, ...) it is perhaps OK to give hints on using DHTML.
One general hint I can give is to use the Opera Browser for
validating/debugging your JavaScript-Code. It has one of the better/more
useful debugging functionalities with its javascript-console (especially
giving you correct line-numbers and hints on whats wrong). often if things
do not work in conjunction with JS it is the javascript that is *not*
working. seldomly its the WOComponent. I have made good experiences
debugging my javascripts with opera though i prefer to use safari as my
default browser.
try to make this work at first without any WebObjects involved (static
html-page and the JS) and be sure it works. this is how i develop these
things, decreasing the number of sources where errors can happen, by leaving
out WO from this game at first.
if the static html-version is working then try to integrate it into your
webobjects component. this way you are on the secure side, that JS is
working perfectly if things still do not work it *must* be WO.
good luck. JS-debugging is nevertheless one of the most painful things i can
think of. if anyone has a better way for debugging JS please let me know.
regards,
helge
Am 29.11.2005 16:42 Uhr schrieb "Wolfram Stebel" unter
<email@hidden>:
> 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:
>
> This email sent to email@hidden
--
Helge Städtler
- Expect and Respect.
_______________________________________________
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