Commit 1245d31a authored by michael.simon's avatar michael.simon
Browse files

remove bug on loading script edit page

parent 1a8699a0
......@@ -35,12 +35,11 @@ public class EditScriptBean implements Serializable {
private Long id;
public void preRenderView(ComponentSystemEvent ev) {
entity = service.findById(id);
}
public String save() {
service.save(entity);
return ViewIds.SHOW_SCRIPT + "?faces-redirect=true&scriptId=" + entity.getId();
return ViewIds.SHOW_SCRIPT + "?faces-redirect=true&scriptId=" + getEntity().getId();
}
public String cancel() {
......@@ -48,6 +47,10 @@ public class EditScriptBean implements Serializable {
}
public ScriptEntity getEntity() {
if (entity == null) {
entity = service.findById(id);
}
return entity;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment