Posted on 2009-03-23 14:40
董锐 阅读(289)
评论(0) 编辑 收藏
在tapestry5的页面中,添加如下代码
@Inject
@Service("ApplicationGlobals")
private ApplicationGlobals applicationGlobals;
@SetupRender
void setListener(){
Clock.setListener(this);
}
public void setClockDisplay(final String output) {
Browser.withPage(ServerContextFactory.get(applicationGlobals.getServletContext()),"/manageCar/Dwrtracker", new Runnable() {
public void run() {
// Util.setValue("clockDisplay", output);
System.out.println("updateClockValue");
ScriptSessions.addFunctionCall("updateClockValue", output);
}
});
}
interface IClockListener {
public void setClockDisplay(final String output);
}