简体   繁体   English

删除index.html GWT

[英]Remove index.html GWT

Hy , I am creating an login/logout system with GWT. 嗨,我正在用GWT创建一个登录/注销系统。 User is prompted with index.html , enters user , pass , server verify`s it and sands back true or false , this part is done and working. 用index.html提示用户,输入user,pass,服务器验证它并回滚true或false,这部分就完成了并工作。 Now i am creating a widget for an administration part. 现在,我正在为管理部分创建一个小部件。 If the response is true i would like to send him to administration widget , i created that too , and works. 如果响应是正确的,我想将他发送到管理小部件,我也创建了它,并且可以工作。 The problem is that the login screen does not disappear when i use 问题是我使用时登录屏幕不会消失

  RootPanel.get().add(widget);

And i would like to "hide" all the login part... 我想“隐藏”所有登录部分...

为什么不能将所有登录内容都包裹在一个巨大的div ,让GWT添加一种样式,该样式在登录成功后display:none

Widgets will be in the DOM until detached (removed). 小部件将一直位于DOM中,直到分离(移除)为止。 You'll need to manually remove the widget. 您需要手动删除小部件。 Adding another widget will not remove the preceding widget. 添加其他窗口小部件不会删除前面的窗口小部件。

RootPanel.get().remove(myWidget);

Or add a class to it: 或添加一个类:

myWidgetInstantiation.getStyle().setVisible(VISIBILITY.Hidden);

Read this: Multiple pages tutorial in Google Web Toolkit (GWT) 阅读本文: Google Web Toolkit(GWT)中的多页教程

It goes over how to have multiple "pages" within the context of GWT. 它讨论了如何在GWT上下文中具有多个“页面”。 The guide is a little out of date but should help move in the right direction. 该指南有些过时,但应有助于朝正确的方向发展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM