New Post object does not result in object in database. Object is created by call to addPost method of Blog in newPost template:


define newPost(b: Blog) {
action new() {
var p := b.addPost();
log(“newPost: " + p.key);
return post(p,”");
}
submitlink new() { “New Post” }
}

https://github.com/eelcovisser/blog/blob/master/blog/blog-view.app

This the addPost method:


entity Post {

function addPost(): Post {
var p := Post{
number := lastPost.next()
blog := this
title := “No Title”
};
p.key := p.number + "";
authors.add(principal());
p.save();
postCount := null;
postPublicCount := null;
log("created new post with key " + p.key);
return p;
}
}

https://github.com/eelcovisser/blog/blob/master/blog/blog-model.app

Submitted by Eelco Visser on 4 September 2012 at 13:33

On 4 September 2012 at 13:45 Eelco Visser commented:


$ which webdsl
/Applications/eclipse/plugins/webdsl.editor_1.2.9.201208252301/webdsl-template/webdsl

No exception in log; only when redirecting to the new page:


created new post with key 230
newPost: 230
No entity with this identity found: 230
exception occured while handling request URL: http://localhost:8080/blog/post/230
exception message: No entity with this identity found: 230
java.lang.RuntimeException: No entity with this identity found: 230
at webdsl.generated.templates.PostPage.loadArguments(PostPage.java:417)
at webdsl.generated.templates.PostPage.initVarsAndArgs(PostPage.java:57)


On 7 September 2012 at 15:53 Danny Groenewegen commented:

underlying issues are http://yellowgrass.org/issue/WebDSL/454 and http://yellowgrass.org/issue/WebDSL/589

Log in to post comments