-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have an app using zk and at some point I call a javascript that shows an outer div containing a search panel
(Clients.evalJavaScript("showMySearchDIV()");).
I want the DIV'S javascript event onclick() to set the value of the zk textbox. This search panel is located at another div and it is pure html/javascript.
thanks.
I am a bit surprised by the question. The previous example already showed a server side listener using zscript which is helps to create more compact examples
<textbox id="txtBxId" value=""
onChange="Clients.showNotification(event.getValue());"/>
The same listener can be registered in a Composer class: http://zkfiddle.org/sample/28or1m7/4-set-textbox-value-from-client
public void onChange$txtBxId(InputEvent event) {
Clients.showNotification(event.getValue());
}
or in a SelectorComposer
@Listen("onChange=#txtBxId")
public void onMyInputChanged(InputEvent event) {
Clients.showNotification(event.getValue());
}
I assume you see the pattern, all of the above are executed in the server side JVM. I wonder how the rest of your application is implemented, if the above information doesn't help, please let me know.
Asked: 2011-03-30 17:08:28 +0800
Seen: 1,234 times
Last updated: Nov 19 '18