浏览 375 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
最后更新时间:2008-05-28
新增功能 1.直接获得html页面元素,无需实例化对象,如:Image imgButton = (Image)super.getGwtWidget("imageBt") 2.相同流程页面,写在同一个模板,通过templateElementId变换显示的Div,用于一个流程,不需定义两三个html对象与页面
模拟JAVA代码 //定义使用login2.html页面,显示的div为gwtid=LoginPopPanel
public LoginPopPanel() {
super("login_template/login2.htm", "LoginPopPanel");
}
/**
* 获得页面对象的引用
*/
protected void beforeFlushChildren() {
txtVehicleNo = (TextBox) super.getGwtWidget("txtVehicleNo");
txtPsw = (PasswordTextBox) super.getGwtWidget("txtPsw");
}
/*
* 模板装载完成,
*/
protected void afterTemplateLoaded() {
//使用模板页面的另外一个Div,免除页面跳转
changeDiv("LoginSuccessDiv");
}
新旧模板保持这样的写法是兼容的。兼容组建构造方式。 changeDiv(ElementId)是旧模板的方法,新模板则使用setHtml替换页面
声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |



