6.7 页面跳转问题

6.7版本,想使用网址跳转到某个编辑页面,能否使用http://localhost:8080/app/open?screen=sec$User.edit&fid=1001,这个fid是建表时建的字段,设为id了。能否根据这个id来进入编辑页面。查看文档:https://doc.cuba-platform.com/manual-6.10/link_to_screen.html。有没有更详细的例子。

用文档里的这种方法:
image

把你的地址改成 http://localhost:8080/app/open?screen=sec$User.edit&params=fid:1001

这样在editor的init方法中,你可以通过params参数取到传入的fid,然后根据fid查找到对应的entity,将它设置到datasource中:

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);


        String fid=  params.get("fid");
        //根据fid查找entity
       Entity       entity = xxxxxx;
       datasourceDs.setItem(entity);

例子暂时没有,你先试试这个方法