通过browse里的按钮点击跳转到edit页面出错。

我现在有一个browse页面,将里面的create按钮不绑定默认的action,在控制器中的方法里面实现页面跳转的时候,出现“IllegalArgumentException: entity is null”
image
image

编辑界面在初始化的时候需要提供一个可供编辑的实体,可以是新实体或者需要编辑的实体:

screenBuilders.editor(Shoes.class,this)
        .withScreenClass(ShoesEdit.class)
        .newEntity() // 新建一个实体传给界面
        .withInitializer(shoes -> { // 按需初始化数据
            shoes.setStudentId(studentId);
        })
        .build().show();

然后在编辑界面,可以通过 getEditedEntity() 方法获取正在编辑的实体,进行其他需要的操作。

好的 谢谢 解决了