-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3610625
By: tskale
I have the following code fragment:
<button label="Doit" action="onclick:funA()">
<attribute name="onClick">
process(); </attribute>
</button>
The funA()needs to be called on the client only after process() method is evaluated.
The logic in the process() method will decide if funA() should be executed or not. As it stands now, I have no control over funA(). Is there a way to call
funA() from within process() method?
Any help in how to implement this will be appreciated.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3611356
By: nobody
What you request is really the bottom line of how Ajax is working.
I think ZK team should be able to provide some kind of special component that user can "run" a specific javascript programmatically, etc.
Say,
<javascriptrunner id="myRunner" action="funA();"/>
and the server code can call an API like myRunner.run(), thus the funA() javascript would be run programmatically.
The better part is that you can dynamically download the javascript into the action attribute and basically you can "inject" javascript dynamically. Of course, in such case, you have to handle all the browser compatiblity issue. I don't know why you need to write your own javascript. Personally, I feel that ZK has provided enough components.
Anyway, good luck. Maybe you want to post a request to them?
My 2 cents.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3611447
By: tskale
I am integrating Google Map API in my application. To load data on map, I have to use Javascript and use XMLHTTPRequest in the browser since the map component which is embedded in the ZK iframe is not available on the server side (or I don't know how to access it)
The ability to communicate with Javascript objects in browser is, I think, a must. This will allow one to create location based applications using Yahoo or Google APIs.
Laszlo provides such functionality with their LzBrowser object but I liked ZK's approach to Ajax and so tried to use their platform.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3611649
By: tomyeh
CSA is independent of ZK's default behavior. In your class, funcA shall be executed (as JavaScript) at the client, while process is executed (by BeanShell) at the server.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3611652
By: tomyeh
I know nothing about Google Map API -- yet :)
If I read correctly, the Map object is in an iframe. Then, you want to talk back the server when intercepting some events sent by Google Map API. Right?
In this case, you could use
parent.zkau.send(...)
The parent of iframe (at the client) is where other ZK components and JavaScript codes reside.
You might also take a look at fileupload-done.dsp in zul.jar. Fileupload is done in an iframe, too.
Good luck and share us any progress.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3612179
By: tskale
Thanks for the help.
I got it to work now.
Asked: 2006-03-04 15:52:27 +0800
Seen: 681 times
Last updated: Mar 05 '06