作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
第一:我很震惊,不得不问这个问题。在文档中没有任何地方解释了应如何使用新的“WindowManager” ...我一直在围绕此进行数小时的学习,但我仍然没有一种令人满意的方法来完成如此琐碎的事情:
def vName = 'Error'
if (!app.views[vName]) { //I just want to create it once, otherwise I'd just change it's model and want to show() it!
buildMVCGroup(vName, vName, errorCode: 500, message: "fail detected ;-)") //ok, this indeed shows the idem (as it's an "frame(/**/show: true,/*...*/", but I dont want to create it each time
}
// app.windowManager.show(app.views.Error) //fails, show() want's an Window, and app.views.Error is of ErrorView type
// app.views.Error.visible = true //won't display the view
// app.views.Error.show() // there is no such method
//in controller
def view
def hideAction = {
//view.hide() //fails, no such method...
}
最佳答案
对于框架-我所做的...
在我看来,我为框架命名application(name: 'login', ...
然后在我的 Controller 中
app.windowManager.hide(app.windowManager.findWindow('login'))
app.windowManager.show(app.windowManager.findWindow('workspace'))
所以...我确保我对所有 View 都“命名”,然后可以轻松地在窗口管理器中显示/隐藏...
您对文档的权利。我希望我正在做的也是“正确的事情”。
关于groovy - 如何在Griffon中轻松显示/隐藏 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4356871/
我是一名优秀的程序员,十分优秀!