You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christopher Yates <CA...@co.stark.oh.us> on 2005/03/03 21:02:13 UTC

An idea - MappedForm's

Tell me what you think about this idea.  Maybe it exists already, maybe
it's just bad design, I don't know.
 
A component library that maps a form around a class.  So you would have
like MappedForm class="com.pack.Class" and then for each field you would
specify a property name to map the field to, ognl-style.
 
Then whenever they submit the form it automatically populates and
returns the given class with the values from the fields.
 
There are a number of reasons this would be useful, mainly b/c of the
features of Hibernate.  For example; to create a search page, all you
would have to do is:
Create a page with a @MappedForm class="com.foo.Company"
On the submit listener ->
setResults(myServiceManager.getCompaniesByExample( returnedClass );
In the hibernate service -> return
hbSession.createCriteria(com.foo.Company).add(
Example.create(returnedClass).ignoreCase().excludeZeroes().enableLike()
).list();
 
Or to update / add new records, just pass the returnedClass to
hibernate.
 
Wouldn't this speed up generic CRUD screen development time quite a
bit?  Thanks.
 
-
Chris Yates
Stark County Information Technology
330-451-7432 x4405

Re: An idea - MappedForm's

Posted by Henri Dupre <he...@gmail.com>.
Thanks alot for the link!! That's exactly what I'd need for some intranet stuff.
Why isn't there a link somewhere on the Tapestry web site about this project?

Henri.


On Thu, 03 Mar 2005 13:15:19 -0700, Danny Mandel <dm...@tolweb.org> wrote:
> It's not entirely the same thing, but the Trails project has a similar
> idea behind it.
> 
> https://trails.dev.java.net/
> 
> Christopher Yates wrote:
> 
> >Tell me what you think about this idea.  Maybe it exists already, maybe
> >it's just bad design, I don't know.
> >
> >A component library that maps a form around a class.  So you would have
> >like MappedForm class="com.pack.Class" and then for each field you would
> >specify a property name to map the field to, ognl-style.
> >
> >Then whenever they submit the form it automatically populates and
> >returns the given class with the values from the fields.
> >
> >There are a number of reasons this would be useful, mainly b/c of the
> >features of Hibernate.  For example; to create a search page, all you
> >would have to do is:
> >Create a page with a @MappedForm class="com.foo.Company"
> >On the submit listener ->
> >setResults(myServiceManager.getCompaniesByExample( returnedClass );
> >In the hibernate service -> return
> >hbSession.createCriteria(com.foo.Company).add(
> >Example.create(returnedClass).ignoreCase().excludeZeroes().enableLike()
> >).list();
> >
> >Or to update / add new records, just pass the returnedClass to
> >hibernate.
> >
> >Wouldn't this speed up generic CRUD screen development time quite a
> >bit?  Thanks.
> >
> >-
> >Chris Yates
> >Stark County Information Technology
> >330-451-7432 x4405
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: An idea - MappedForm's

Posted by Danny Mandel <dm...@tolweb.org>.
It's not entirely the same thing, but the Trails project has a similar 
idea behind it.

https://trails.dev.java.net/

Christopher Yates wrote:

>Tell me what you think about this idea.  Maybe it exists already, maybe
>it's just bad design, I don't know.
> 
>A component library that maps a form around a class.  So you would have
>like MappedForm class="com.pack.Class" and then for each field you would
>specify a property name to map the field to, ognl-style.
> 
>Then whenever they submit the form it automatically populates and
>returns the given class with the values from the fields.
> 
>There are a number of reasons this would be useful, mainly b/c of the
>features of Hibernate.  For example; to create a search page, all you
>would have to do is:
>Create a page with a @MappedForm class="com.foo.Company"
>On the submit listener ->
>setResults(myServiceManager.getCompaniesByExample( returnedClass );
>In the hibernate service -> return
>hbSession.createCriteria(com.foo.Company).add(
>Example.create(returnedClass).ignoreCase().excludeZeroes().enableLike()
>).list();
> 
>Or to update / add new records, just pass the returnedClass to
>hibernate.
> 
>Wouldn't this speed up generic CRUD screen development time quite a
>bit?  Thanks.
> 
>-
>Chris Yates
>Stark County Information Technology
>330-451-7432 x4405
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org