Clients.evalJavaScript don' t work with datebox

asked 2011-04-15 16:04:14 +0800

soumaya gravatar image soumaya
99 1


I need to use Clients.evalJavaScript inside zscript.
The probleme is I can't work with date.

if I write String start="2011-04-15" i don't get the result


thanks for any help

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-04-15 16:32:21 +0800

mjablonski gravatar image mjablonski
1284 3 5

Please post a simple self-contained example which shows the problem.

Cheers, Maik

link publish delete flag offensive edit

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

soumaya gravatar image soumaya
99 1

updated 2011-04-16 05:35:31 +0800

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.

		<window id="win">

		<groupbox id="gb" >
				<datebox id="startDate" format="dd-MM-yyyy" />
			<listbox id="list">
				<listhead sizable="true">
					<listheader label="list" />
			<button id="bt" label="send" onClick="test()" />


<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();

//javascript function wich call a servlet
function testjsfunction(parameter){
					$.getJSON("servlettest?parameter="+parameter+"",{} ,function(data){

link publish delete flag offensive edit

answered 2011-04-18 21:00:35 +0800

dennis gravatar image dennis
3669 1 6

no test you case, but it looks like you have wrong js. you miss quotes


testjsfunction(' " + datestart + " ') " (add more space to show you)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2011-04-15 16:04:14 +0800

Seen: 597 times

Last updated: Apr 18 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More