Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form for "tag" #4

Open
luiz opened this issue Jan 18, 2011 · 3 comments
Open

Form for "tag" #4

luiz opened this issue Jan 18, 2011 · 3 comments

Comments

@luiz
Copy link
Owner

luiz commented Jan 18, 2011

An initial implementation is already available. The idea is to allow the generation of a form based upon a model of our system (an User, a Product etc.). For instance, the following code:

Product prod = new Product();
...
formFor(prod)
...

would generate a complete form for creating (or editing) a product, with an input for each of its fields. Note that this is just an idea. I don't know how feasible it is...

@luiz
Copy link
Owner Author

luiz commented Mar 15, 2011

It would be nice to have ways of specifying which fields should be or, if shorter to specify, should not be included in the generated form.

Ideas:

  • Specifying fields to be included:
    formFor(product, with(product).getName(), with(product).getPrice())
  • Specifying fields not to be included:
    formFor(product, without(product).getId())
  • Annotating fields to be included:
    class Product {
    @FormForField
    private String name;
    }

@rodrigocatalan
Copy link

@luiz
Copy link
Owner Author

luiz commented Mar 23, 2011

Interesting, Rodrigo. That's almost what I'm looking for. It's not perfect
for me because you need to type a considerable amount of code for it to
work, IMHO. Even though, I'm considering using it. Thanks!

Luiz F. O. Corte Real

Vida Geek
http://vidageek.net

Caelum | Ensino e Inovao
http://www.caelum.com.br

On Wed, Mar 23, 2011 at 3:05 PM, rodrigocatalan <
[email protected]>wrote:

look for this similar idea:

https://github.com/rodrigocatalan/brick/blob/master/src/test/java/br/com/ahrpius/brick/forfield/TestForTags.java

Reply to this email directly or view it on GitHub:
#4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants