SMARTGWT - delete DynamicForm from SectionStackSection

家住魔仙堡 提交于 2019-12-24 08:26:46

问题


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.


回答1:


Simply call below line

dynamicForm.getElement().removeFromParent();


来源:https://stackoverflow.com/questions/23327241/smartgwt-delete-dynamicform-from-sectionstacksection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!