[Tapestry4] 求助,一个星期了还是没搞好tacos文档中的例子,各位帮忙看看哪里错了.我快崩溃了
coder_hero
2007-03-27
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>io.html</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript"> var djConfig={ isDebug: true } </script> <script type="text/javascript" src="js/dojo/dojo.js"></script> </head> <body jwcid="@Body"> <form jwcid="loginForm@tacos:AjaxForm" updateComponents="ognl:{'loginForm'} listener="listener:userLogin"> <fieldset> <legend>Login</legend> <input jwcid="username@TextField" value="ognl:userName"/> <a jwcid="@tacos:AjaxSubmit" updateComponents="ognl:{'nameDisplay'}" effects="template:{highlight:{any:'[255,255,184], 500, 500'}}"> Login </a> </form> <div jwcid="nameDisplay@Any" id="nameDisplay"> <span jwcid="@If" condition="ognl:userName" > You entered <span jwcid="@Insert" value="ognl:userName" />. </span> </div> </body> </html> PAGE: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE page-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd"> <page-specification class="com.Home"> </page-specification> 类文件: package com; import net.sf.tacos.ajax.AjaxFormSupport; import org.apache.tapestry.IRequestCycle; import org.apache.tapestry.html.BasePage; public abstract class Home extends BasePage{ public abstract String getUserName(); public abstract void setUserName(String username); public void userLogin(IRequestCycle cycle) { //don't need to do anything, input values are already set } } 我把ajaxform换成普通的t4的form就没问题。 报如下错误 net.sf.tacos.ajax.AjaxFormSupport.render(Ljava/lang/String;Lorg/apache/tapestry/IRender;Lorg/apache/tapestry/engine/ILink;Ljava/lang/String;Ljava/lang/Integer;)V Stack Trace: net.sf.tacos.ajax.components.AjaxForm.renderComponentDelegate(AjaxForm.java:327) net.sf.tacos.ajax.components.AjaxForm.renderComponent(AjaxForm.java:84) $AjaxForm_18.renderComponent($AjaxForm_18.java) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434) org.apache.tapestry.html.Body.renderComponent(Body.java:129) $Body_17.renderComponent($Body_17.java) ........ |
|
tapestry
2007-03-27
<form jwcid="loginForm@tacos:AjaxForm" updateComponents="ognl:{'loginForm'} listener="listener:userLogin"> 改成
<form jwcid="loginForm@tacos:AjaxForm"> <a jwcid="@tacos:AjaxSubmit" updateComponents="ognl:{'nameDisplay'}" effects="template:{highlight:{any:'[255,255,184], 500, 500'}}"> Login </a> 改成 <a jwcid="@tacos:AjaxSubmit" listener="listener:userLogin" updateComponents="ognl:{'nameDisplay'}" effects="template:{highlight:{any:'[255,255,184], 500, 500'}}"> Login </a> 把fieldset标签关掉,tacos对标签的关闭很严格,自己多检查检查。 |
|
letch
2009-01-06
健康是美,平安是福!
|