是否可以删除 FieldSet 然后重新添加它?如何?

发布于 2024-10-02 23:47:10 字数 974 浏览 0 评论 0原文

我得到了一个根据客户想要的内容显示的屏幕。所以这取决于客户的需求。 问题是,当我单击“清理字段”按钮时,我必须删除 3 个字段集。稍后当客户单击“搜索”按钮时重新添加它们。 但是当我尝试删除时,它显示“无法将 FieldSet 的表单设置为 null”作为 IllegalArgumentException。你们有什么想法可以帮助我吗?

ps:如果有巴西人的话,也许我可以用葡萄牙语解释一下。

公共布尔 onCleanClick() {

    this.form.remove(fsResult1);
    this.form.remove(fsResult2);
    this.form.remove(fsSubmits);
    this.profile1.setValue("0");
    this.profile2.setValue("0");
    return true;
}

公共布尔 onComparaPerfisClick(){

            fsSubmits.setShowBorder(false);
            fsSubmits.setColumns(2);
            fsSubmits.add(submitProfile1);
            fsSubmits.add(submitProfile2);

            form.add(fsSubmits, 2);

            fsResult1.add(processProfile1);
            fsResult1.setShowBorder(false);
            fsResult2.add(processProfile2);
            fsResult2.setShowBorder(false);

            form.add(fsResult1);
            form.add(fsResult2);

}

I got a screen that is shown according to what the costumer wants. So it depends on costumers needs.
The problem is, I have to remove 3 FieldSets when I click on "Clean Fields" button. To re-add them later when costumer clicks on "Search" button.
But when I try to remove, it says "Cannot set the FieldSet's form to null" as an IllegalArgumentException. Do you guys have any idea to help me out?

ps: If is there any Brazilians, maybe I can explain it in Portuguese.

public boolean onCleanClick() {

    this.form.remove(fsResult1);
    this.form.remove(fsResult2);
    this.form.remove(fsSubmits);
    this.profile1.setValue("0");
    this.profile2.setValue("0");
    return true;
}

public boolean onComparaPerfisClick(){

            fsSubmits.setShowBorder(false);
            fsSubmits.setColumns(2);
            fsSubmits.add(submitProfile1);
            fsSubmits.add(submitProfile2);

            form.add(fsSubmits, 2);

            fsResult1.add(processProfile1);
            fsResult1.setShowBorder(false);
            fsResult2.add(processProfile2);
            fsResult2.setShowBorder(false);

            form.add(fsResult1);
            form.add(fsResult2);

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

絕版丫頭 2024-10-09 23:47:10

我终于可以做到了。
我没有找到从表单中删除 fieldSet 的方法,取而代之的是,我在表单上添加了 fieldset,但没有任何东西
当我需要时,我添加了一些东西,当我单击清除按钮时,我从字段集中删除了一些东西,并且从表单中删除了任何内容

I finally could do it.
I didn't find a way to remove a fieldSet from a form, instead of it, i added the fieldset on form without a thing
when i needed i added stuff, and when i clicked on clear button, i removed stuff from fieldset, and nothing from the form

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文