>Am 29.11.2005 18:21 Uhr schrieb "Ute Hoffmann" unter ><[EMAIL PROTECTED]>:
Hello all, for all of you not reading german too good: Ute recommended to use JSConfirmPanel from Javascript Palette. Best tip for a long time :-) Enclosed you can find a component that i use on all places where i want to have a confirmation on a submit. The component has three bindings: 1. the action to invoke on confirm 2. the message to display for confirmation 3. a flag, if confirmation is necessary (i bind it usually to a flag of the users settings (yes, please confirm all deletes)) For useage i embed a button inside the Component and bind the action of the button to the components action. Realy easy, you all will understand :-) One pitfall: not all browser display the component absolutely perfect, some might show an underline above or beside the button (as i use it) because it is in fact a hyperlink. So far i used it only for confirmation of deletes and probably the hyperlink will not result in a full RR-loop, so it will not work for data updates, i expect... HTH Wolfram P.S. I don't need to do all this javascript stuff to transfer values myself, so i still dont know how it realy works :--))) P.P.S. Please apologize for beeing proud of such a simple hack > Hallo Wolfram, > Ich benutze für die Bestätigung, dass ein Datensatz gelöscht werden > soll, JSConfirmPanel aus der WebObjects Javascript Palette. > > Du kannst dort > eine Action anbinden, was passieren soll, wenn Ja geklickt wird und > eine Bestätigungsnachricht. > > Ich habe das allerdings nie in einem Formular mit einem Submit-Button > eingesetzt, sondern eher in Repetitions mit Datensätzen. > > Wenn Du keine Formwerte übergeben musst, dann kannst Du ja anstelle des > Submit-Buttons ein Bild verwenden. Dann geht es mit dem JSConfirmPanel > (Name aus dem Gedächtnis, kann etwas anders heissen). Ansonsten kannst > Du den Code dieser Komponente als Ausgangspunkt nehmen für eine eigene > Komponente... > > Wenn Du eine Action in einem Javascript aufrufen möchtest ist > WOActionURL Dein Freund. Du definierst die Action, die Du möchtest im > .wod und setzt die ActionURL an der Stelle in das Javascript, wo die > URL gebraucht wird. Muss man, glaube ich, im Source machen, > funktioniert aber gut. > > Ich hoffe das hilft Dir weiter, > > Viele Grüße > > Ute > > Am Dienstag, 29.11.05 um 16:42 Uhr schrieb Wolfram Stebel: > >> 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? :-)
WOComponent_Confirm.zip.sit
Description: Macintosh archive
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com