That markup should be in a template file somewhere, which would then call
the snippets appropriately. I don't see markup for a second form, but I
might just be missing it.
A couple of other notes:
- Generally, on links, omit the suffix and Lift will then do I18N lookup
for you as needed. That means use "/contact/person/edit" instead of
"/contact/person/edit.html"
- When you're deleting in JPA, there's no need to do a merge first. Just
obtain a reference instead and delete that. It's more efficient. Your code
would look like:
def doDelete() = {
try {
Model.removeAndFlush(Model.getReference(classOf[Person],
person.getId());
notice("Deleted " + person.getFirstName() + " " +
person.getLastName())
redirectTo("/contact/list")
} catch {
case pe: PersistenceException => error("Error removing person");
Log.error("Error removing person", pe);
}
}
On Wed, Nov 25, 2009 at 4:26 PM, Timothy Perrett <[email protected]>wrote:
> Lift does not use markup like that - there is no magic mapping between
> persistence and view.
>
> You would most likly have to construct the appropriate master -> detail
> code in your snippets and work like that.
>
> Cheers, Tim
>
> On 25 Nov 2009, at 23:16, Jim Barrows wrote:
>
> > I'm using JPA, and need to do a One->Many, or master detail view. So I
> tried the obvious:
> > <lift:PersonSnippets.save form="post">
> > <!-- form -->
> > </lift:PersonSnippets.save>
> > <lift:PersonSnippets.addContactMechanism form="post">
> > </lift:PersonSnippets.addContactMechanism>
> >
> > However, the HTML that gets generated is the same form for both.
> > Is there an example somewhere I've missed about how to do this?
> > --
> > James A Barrows
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> "Lift" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected]<liftweb%[email protected]>
> .
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.