SMARTGWT - 从SectionStackSection中删除DynamicForm [英] SMARTGWT - delete DynamicForm from SectionStackSection

查看:109
本文介绍了SMARTGWT - 从SectionStackSection中删除DynamicForm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有同样的问题,提到这里。这个问题被误解了,我没有评论的特权,所以我创建了这个问题。他想从SectionStackSection对象中删除一个DynamicForm。我的情况如下:我通过使用setFields(FormItem ... fields)方法向SectionStackSection添加了一些DynamicForm对象,并且我还添加了一个Button,用于从SectionStackSection中删除此FormItem。问题是一样的。也试过了DynamicForm.removeFromParent(),但是父对象在DynamicForm中为null。

编辑:这就是我的SectionStack的构建:

  SectionStack 
SectionStackSection
DynamicForm df1 //通过SectionStackSection.addItem(df1)添加
按钮btn1 //通过DynamicForm.addChild添加(btn1)
ClickHandler ch1
FormItem [] fiList1 //通过DynamicForm.setFields(fiList1)添加
DynamicForm df2 //通过SectionStackSection.addItem(df2)添加
按钮btn2 / /添加到DynamicForm.addChild(btn2)
ClickHandler ch2
FormItem [] fiList2 //通过DynamicForm.setFields(fiList2)添加
// ... ...添加更多DynamicForm对象
DynamicForm dfX
Button btnX
ClickHandler chX
FormItem [] fiListX
SectionStackSection
// ...
// ...

按btn1举例,df1应该被删除。

解决方案

只需在下方行

即可

  dynamicForm.getElement()removeFromParent(); 


I have the same problem, that is mentioned here. The problem got missunderstood and I don't have the privileg to comment so I created this question. He wants to delete a DynamicForm out of an SectionStackSection object. my situation is the following: I added some DynamicForm objects to the SectionStackSection by using the setFields(FormItem... fields) method and I also added a Button to delete this FormItem out of the SectionStackSection. The problem's the same. Also Tried DynamicForm.removeFromParent(), but the parent object is null in DynamicForm.

EDIT: That's how my SectionStack is build:

SectionStack
  SectionStackSection
     DynamicForm df1 // added via SectionStackSection.addItem(df1)
       Button btn1 // added via DynamicForm.addChild(btn1)
         ClickHandler ch1
       FormItem[] fiList1 // added via DynamicForm.setFields(fiList1)
     DynamicForm df2 // added via SectionStackSection.addItem(df2)
       Button btn2 // added via DynamicForm.addChild(btn2)
         ClickHandler ch2
       FormItem[] fiList2 // added via DynamicForm.setFields(fiList2)
     // ... some more DynamicForm objects added
     DynamicForm dfX
       Button btnX
         ClickHandler chX
       FormItem[] fiListX
  SectionStackSection
    // ...
  // ...

By pressing btn1 for example, df1 should be deleted. The SectionStackSection should be stil shown.

解决方案

Simply call below line

dynamicForm.getElement().removeFromParent();

这篇关于SMARTGWT - 从SectionStackSection中删除DynamicForm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆