Grails Tab Library

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails Tab Library

graemer
Thought I would move this into a separate thread. For those of you who
are interested or want to contribute ideas the Grails tag library spec
is taking shape here:

http://grails.codehaus.org/Tag+Library+Reference

At the moment we have 3 tags proposed with many more to come I'm
sure.. let me know your ideas.

Graeme
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

Steven Devijver
Templates are supported in JSP:

http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/


On 12/16/05, Graeme Rocher <[hidden email]> wrote:

> Thought I would move this into a separate thread. For those of you who
> are interested or want to contribute ideas the Grails tag library spec
> is taking shape here:
>
> http://grails.codehaus.org/Tag+Library+Reference
>
> At the moment we have 3 tags proposed with many more to come I'm
> sure.. let me know your ideas.
>
> Graeme
>


--
"If you want to be a different fish, you gotta jump out of the school."
-- Captain Beefheart
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

graemer
Very true, not sure everyone knows about them though as they're not
promoted very much... need to educate people :-)

Graeme

On 16/12/05, Steven Devijver <[hidden email]> wrote:

> Templates are supported in JSP:
>
> http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/
>
>
> On 12/16/05, Graeme Rocher <[hidden email]> wrote:
> > Thought I would move this into a separate thread. For those of you who
> > are interested or want to contribute ideas the Grails tag library spec
> > is taking shape here:
> >
> > http://grails.codehaus.org/Tag+Library+Reference
> >
> > At the moment we have 3 tags proposed with many more to come I'm
> > sure.. let me know your ideas.
> >
> > Graeme
> >
>
>
> --
> "If you want to be a different fish, you gotta jump out of the school."
> -- Captain Beefheart
>
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

graemer
Although it may be good to allow users to use groovy templates in this
way? What do you think?

Graeme

On 17/12/05, Graeme Rocher <[hidden email]> wrote:

> Very true, not sure everyone knows about them though as they're not
> promoted very much... need to educate people :-)
>
> Graeme
>
> On 16/12/05, Steven Devijver <[hidden email]> wrote:
> > Templates are supported in JSP:
> >
> > http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/
> >
> >
> > On 12/16/05, Graeme Rocher <[hidden email]> wrote:
> > > Thought I would move this into a separate thread. For those of you who
> > > are interested or want to contribute ideas the Grails tag library spec
> > > is taking shape here:
> > >
> > > http://grails.codehaus.org/Tag+Library+Reference
> > >
> > > At the moment we have 3 tags proposed with many more to come I'm
> > > sure.. let me know your ideas.
> > >
> > > Graeme
> > >
> >
> >
> > --
> > "If you want to be a different fish, you gotta jump out of the school."
> > -- Captain Beefheart
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

graemer
Just to clarify my idea for the template tag we have already discussed
how components for scaffolding will be registered in the application
context for configurational purposes. So the template tag will be
responsable for either accessing internal default templates (from the
app context) or accessing user defined templates (ie of the groovy
template type) hence allowing users to customise scaffolding *gasp*
;-)

Cheers,
Graeme

On 17/12/05, Graeme Rocher <[hidden email]> wrote:

> Although it may be good to allow users to use groovy templates in this
> way? What do you think?
>
> Graeme
>
> On 17/12/05, Graeme Rocher <[hidden email]> wrote:
> > Very true, not sure everyone knows about them though as they're not
> > promoted very much... need to educate people :-)
> >
> > Graeme
> >
> > On 16/12/05, Steven Devijver <[hidden email]> wrote:
> > > Templates are supported in JSP:
> > >
> > > http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/
> > >
> > >
> > > On 12/16/05, Graeme Rocher <[hidden email]> wrote:
> > > > Thought I would move this into a separate thread. For those of you who
> > > > are interested or want to contribute ideas the Grails tag library spec
> > > > is taking shape here:
> > > >
> > > > http://grails.codehaus.org/Tag+Library+Reference
> > > >
> > > > At the moment we have 3 tags proposed with many more to come I'm
> > > > sure.. let me know your ideas.
> > > >
> > > > Graeme
> > > >
> > >
> > >
> > > --
> > > "If you want to be a different fish, you gotta jump out of the school."
> > > -- Captain Beefheart
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

Guillaume Laforge-2
In reply to this post by graemer
On 16/12/05, Graeme Rocher <[hidden email]> wrote:
> [...]
> http://grails.codehaus.org/Tag+Library+Reference
>
> At the moment we have 3 tags proposed with many more to come I'm
> sure.. let me know your ideas.

While playing with Grails a little these days, and particularly while
using the scaffolded controllers, I came to the idea that we could
also provide a tag for displaying different template views for domain
classes.

The tag could provide different kind of views:

- a default display view of an instance of a domain class (with a
simple table with labels right-aligned, and associated values in the
left column)

- a form view with a table like above, pre-filled if the bean is in
the current scope, or void for a creation, with the right widgets for
each type of bean property (checkbox, date picker, text area, etc...)

- a third optional but interesting view could be a mix of the two
above with something like edit-in-place table which would replace the
values with input widgets when clicking on the value label

<gr:bean view="display|form|edit-in-place" form="formName"
bean="beanName" domain-class="MyBean" />

Moreover, it could also handle the spring:hasError stuff, and display
error messages, wrong values highlighted in red, and so on.

What do you think?

--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

graemer
On 29/12/05, Guillaume Laforge <[hidden email]> wrote:

> On 16/12/05, Graeme Rocher <[hidden email]> wrote:
> > [...]
> > http://grails.codehaus.org/Tag+Library+Reference
> >
> > At the moment we have 3 tags proposed with many more to come I'm
> > sure.. let me know your ideas.
>
> While playing with Grails a little these days, and particularly while
> using the scaffolded controllers, I came to the idea that we could
> also provide a tag for displaying different template views for domain
> classes.
>
> The tag could provide different kind of views:
>
> - a default display view of an instance of a domain class (with a
> simple table with labels right-aligned, and associated values in the
> left column)
>
> - a form view with a table like above, pre-filled if the bean is in
> the current scope, or void for a creation, with the right widgets for
> each type of bean property (checkbox, date picker, text area, etc...)
>
> - a third optional but interesting view could be a mix of the two
> above with something like edit-in-place table which would replace the
> values with input widgets when clicking on the value label
>
> <gr:bean view="display|form|edit-in-place" form="formName"
> bean="beanName" domain-class="MyBean" />
>
> Moreover, it could also handle the spring:hasError stuff, and dislikplay
> error messages, wrong values highlighted in red, and so on.
>
> What do you think?

Sounds like a cool idea and perfectly feasable... possibly the name of
the tag needs to be displayBean or something like that has gr:bean
sounds to similar to the jsp bean tag which is more for accessing the
bean...

With regards to the hasError stuff i want to create tags that abstract
spring there are not that many spring tags and the MVC framework used
in grails should be transparent.. At the moment you dont need the
hasErrors stuff with grails controllers.. doing this will pull out all
the errors:

<c:forEach var="e" items="${errors}">
      <p><fmt:message key="${e.code}" /></p>
</c:forEach>

Graeme

>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>
Reply | Threaded
Open this post in threaded view
|

Fwd: Grails Tab Library

Guillaume Laforge-2
---------- Forwarded message ----------
From: Guillaume Laforge <[hidden email]>
Date: 30-Dec-2005 12:23
Subject: Re: [grails-dev] Grails Tab Library
To: [hidden email]


> Sounds like a cool idea and perfectly feasable... possibly the name of
> the tag needs to be displayBean or something like that has gr:bean
> sounds to similar to the jsp bean tag which is more for accessing the
> bean...

Hmm, right, the name wasn't very good.
displayBean sounds better and is much less confusing.

> With regards to the hasError stuff i want to create tags that abstract
> spring there are not that many spring tags and the MVC framework used
> in grails should be transparent.. At the moment you dont need the
> hasErrors stuff with grails controllers.. doing this will pull out all
> the errors:
>
> <c:forEach var="e" items="${errors}">
>       <p><fmt:message key="${e.code}" /></p>
> </c:forEach>

Ah, right.
Here, we're showing all the errors in a row, how can we have errors
for each field of the bean?
Rather than showing all the errors at the top or bottom of the form.
Could we associate each reported error with each field?

--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

Guillaume Laforge-2
In reply to this post by Guillaume Laforge-2
On 29/12/05, Guillaume Laforge <[hidden email]> wrote:
> While playing with Grails a little these days, and particularly while
> using the scaffolded controllers, I came to the idea that we could
> also provide a tag for displaying different template views for domain
> classes.

I've added that tag to the Confluence page:
http://grails.codehaus.org/Tag+Library+Reference

--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: Grails Tab Library

graemer
In reply to this post by graemer
On 30/12/05, Guillaume Laforge <[hidden email]> wrote:

> > Sounds like a cool idea and perfectly feasable... possibly the name of
> > the tag needs to be displayBean or something like that has gr:bean
> > sounds to similar to the jsp bean tag which is more for accessing the
> > bean...
>
> Hmm, right, the name wasn't very good.
> displayBean sounds better and is much less confusing.
>
> > With regards to the hasError stuff i want to create tags that abstract
> > spring there are not that many spring tags and the MVC framework used
> > in grails should be transparent.. At the moment you dont need the
> > hasErrors stuff with grails controllers.. doing this will pull out all
> > the errors:
> >
> > <c:forEach var="e" items="${errors}">
> >       <p><fmt:message key="${e.code}" /></p>
> > </c:forEach>
>
> Ah, right.
> Here, we're showing all the errors in a row, how can we have errors
> for each field of the bean?
> Rather than showing all the errors at the top or bottom of the form.
> Could we associate each reported error with each field?

The "errors" instance is an instance of
http://www.springframework.org/docs/api/org/springframework/validation/Errors.html
that has various methods for retrieving errors for each field

Graeme

>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>