Let me just add a precision,
Event.simulate.js is a member of the Prototype.js ecosystem, smartly written by Juriy Zaytsev, alias "kangax", a front end web developer based in New York, involved in exploring and taming various aspects of Javascript, and ex- Prototype.js core developer. (I guess jQuery offers an equivalent to Event.simulate()
Juriy has a helpful blog - perfection kills - where you can find very interesting, high level articles about JavaScript, Prototype and Browsers.
Event.simulate() offers an option parameter where you can curry properties into the event object; this can be useful for writing an automated demonstration of your FoxInCloud'ified application.
Scheduled by the end of this month, next version of FoxInCloud::DOMEvent() will include a 'sync' parameter which can be used for that purpose (sending event synchronously to pace event simulation).
HTH,
thn
Thanks! I had tried some basic js like calling field.onchange. The simulate did just what I needed.
Tuvia,
I think I can understand your issue;
I this use case, you would expect that changing the HTML element's .value would trigger sending an event notification to the server, à la .ProgrammaticChange() in VFP.
As this does not happen automatically in the HTML DOM event model, you need to handle that by code.
I guess your JavaScript calendar has some callBack method when user chooses a new date;
Just implement this method like follows:
This code will execute the blur() event code of your <input type="text"> element, which sends the new date value to the Valid() method of the corresponding VFP object on the server.
HTH,
ThN
On my form I am using the calendarview.js popup calendar designed to work with prototype. It seems to work fine except for one sticking point.
On the form I have an image, say form1_scx-image1. I have a text field with a date, say form1_scx-text1.
In the form's wcHTMLgen method I added
Works great. When I click the image, the calendar comes up, I pick a date, and that data gets filled into the .value property of text1. The JS code does something like:
The form appears correct and the text field appears to have the new date in it. But appearances are deceiving. Somehow FiC does not recognize that the value of text1 has changed, and returns whatever the original value was. Or if I type in a value. But even though the HTML text field is displaying the new value correctly, and vaue is in wcpropSave, you get the new value if you check the HTML text1.value and you get the old value if you check in VFP the text1.value.
IOW despite changing the attribute in the HTML.JS, how do I get VFP/FiC cloud to recognize that change?
p.s. (Thierry: you can see this on the search in iptest)