Revision history [back]

click to hide/show revision 1
initial version

answered 2011-04-16 02:01:30 +0800

soumaya gravatar image soumaya

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){
                ........
}
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More