To do QBE, I would simply modify the getPersons method in Persons.java 

public List<Person> getPersons()
{
    return session.createCriteria(Person.class).add( Example.create(person)
).list();
} 

This would use the person property to list persons list.  Of course, I would
check for person=nulls etc to protect the above and list all if so...the
above is just to simplify.   

However, the input form needs another button in addition to Create/Update. 
Lets say I even manually add it - and call it Search.

How does the EditPerson NOT end up creating a new Person?  In the Struts
world this would simply be a search method within same PersonAction class. 
And the same Person object on the Valuestack would be used as an Hibernate
Example to drive search instead of ending up as parameter of AddPerson and
creating a new record.  

And so on..., generally, how does one single form submit be wired to support
multiple actions?  Or is this frowned upon as bad practice?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Reuse-Edit-Create-for-Query-by-Example-tp5655916p5655931.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to