[Seaside] jQuery variable check for onBlur

bobn at rogers.com bobn at rogers.com
Wed Apr 10 12:59:28 UTC 2013

I posted this on Stack Overflow... no answer so far: 
How do I code a variable check into a Seaside jQuery onSuccess: script?

I have an application with input fields that trigger a value change followed by a re-rendering of the view. It works nicely to provide lively feedback of domain data based on displayed values.
The view shows 'Save' and 'Cancel' buttons if there are changes pending. If the user clicks on either button right after an input field, the onBlur: script of the input fields prevents the button action from taking place. The recommended solution (button click event lost due to the alert box in text box onblur event) is to use the button's 'onmousedown' event to set a global variable that the onBlur script checks.
With my test code I can see the global 'saveCancelButtonClicked' being set, but I don't know how to check the value in order to prevent the rendering step.
html button  onMouseDown:'saveCancelButtonClicked = 1;';...html textInput onBlur:((html jQuery ajax  callback:[:stringValue |selfcheckValue:stringValue]value:html jQuery thisvalue)onSuccess:((html jQuery id:'selectedComponent')load html:[:renderer |renderer script:'console.log(saveCancelButtonClicked); '.selfrenderSelectedComponentOn:renderer]))]
I can see the console.log showing '1' if the save button is pressed. So how do I check the value and skip the 'self renderSelectedComponentOn:' step?
It's easy enough to do in javascript (trivial if statement), but I have not found an example in Seaside.
Thanks for any help,
Bob Nemec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20130410/069bf6b1/attachment.htm

More information about the seaside mailing list