-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
Ok, i would really appreciate your help. Below is a piece of my code.I need to send the selected date and list to a javascript function.
<zk>
<window id="win">
<groupbox id="gb" >
<hbox>
Date:
<datebox id="startDate" format="dd-MM-yyyy" />
</hbox>
<listbox id="list">
<listhead sizable="true">
<listheader label="list" />
</listhead>
</listbox>
<button id="bt" label="send" onClick="test()" />
</groupbox>
<zscript deferrred="true">
import java.text.SimpleDateFormat;
import java.text.DateFormat;
void test() {
DateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy");
String datestart=dateFormat.format(startDate.getValue());
String list=list.getSelectedItem().getLabel();
Clients.evalJavaScript("testjsfunction("+datestart+")");
}
}
</zscript>
//javascript function wich call a servlet
function testjsfunction(parameter){
$.getJSON("servlettest?parameter="+parameter+"",{} ,function(data){
........
}