You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rui Pacheco <ru...@gmail.com> on 2006/05/10 00:15:51 UTC

Validation

Hi all

In Tapestry 4 when doing validation, must I always place the binding tag on
the page specification or can I do it on the .application file?

I am asking because my application uses a fair amount of classes and I am
simply maping pages to classes through the .application file and I am
wondering if I'll have to create all the .page files now.

--
Cumprimentos,
Rui Pacheco

Re: Validation

Posted by Rui Pacheco <ru...@gmail.com>.
Tapestry is helping me avoid a lot of pain....

On 5/10/06, Pedro Viegas <pv...@gmail.com> wrote:
>
> :-D
>
> No pain no gain!
>
> On 5/10/06, Rui Pacheco <ru...@gmail.com> wrote:
> >
> > I was just wondering if I was going to have to write .page files for
> every
> > .html page that required validation.
> > Now that my blindness has been healed, I am happily adding validators=""
> > to
> > all tags on all my .html pages :D
> >
> > On 5/10/06, Pedro Viegas <pv...@gmail.com> wrote:
> > >
> > > If you do all the binding in the .html template, and the class to page
> > > binding in the .application you don't need the .page in Tap4.
> > > Be more specific if this was not the answer you were looking for.
> > >
> > > Regards,
> > >
> > > On 5/9/06, Rui Pacheco <ru...@gmail.com> wrote:
> > > >
> > > > Hi all
> > > >
> > > > In Tapestry 4 when doing validation, must I always place the binding
> > tag
> > > > on
> > > > the page specification or can I do it on the .application file?
> > > >
> > > > I am asking because my application uses a fair amount of classes and
> I
> > > am
> > > > simply maping pages to classes through the .application file and I
> am
> > > > wondering if I'll have to create all the .page files now.
> > > >
> > > > --
> > > > Cumprimentos,
> > > > Rui Pacheco
> > > >
> > > >
> > >
> > >
> > > --
> > > Pedro Viegas
> > >
> > >
> >
> >
> > --
> > Cumprimentos,
> > Rui Pacheco
> >
> >
>
>
> --
> Pedro Viegas
>
>


--
Cumprimentos,
Rui Pacheco

Re: Validation

Posted by Pedro Viegas <pv...@gmail.com>.
:-D

No pain no gain!

On 5/10/06, Rui Pacheco <ru...@gmail.com> wrote:
>
> I was just wondering if I was going to have to write .page files for every
> .html page that required validation.
> Now that my blindness has been healed, I am happily adding validators=""
> to
> all tags on all my .html pages :D
>
> On 5/10/06, Pedro Viegas <pv...@gmail.com> wrote:
> >
> > If you do all the binding in the .html template, and the class to page
> > binding in the .application you don't need the .page in Tap4.
> > Be more specific if this was not the answer you were looking for.
> >
> > Regards,
> >
> > On 5/9/06, Rui Pacheco <ru...@gmail.com> wrote:
> > >
> > > Hi all
> > >
> > > In Tapestry 4 when doing validation, must I always place the binding
> tag
> > > on
> > > the page specification or can I do it on the .application file?
> > >
> > > I am asking because my application uses a fair amount of classes and I
> > am
> > > simply maping pages to classes through the .application file and I am
> > > wondering if I'll have to create all the .page files now.
> > >
> > > --
> > > Cumprimentos,
> > > Rui Pacheco
> > >
> > >
> >
> >
> > --
> > Pedro Viegas
> >
> >
>
>
> --
> Cumprimentos,
> Rui Pacheco
>
>


--
Pedro Viegas

Re: Validation

Posted by Pedro Viegas <pv...@gmail.com>.
Now that's something I have not thought of before!
Nice catch, that must be handy sometimes!
Nice tip Martin... thanks for sharing. :-D

On 5/10/06, Martin Strand <ma...@entcap.se> wrote:
>
> Yep. I mostly use it to generate CSS classes dynamically:
> <binding name="class" value="ognl:(itemActive ? 'active' : 'inactive')"/>
>
> On Wed, 10 May 2006 21:40:20 +0300, Sam Gendler
> <sg...@ideasculptor.com> wrote:
>
> > On 5/10/06, Martin Strand <ma...@entcap.se> wrote:
> >> I often put informal parameters in my .page file, it seems to work
> fine.
> >
> > Hmph.  I guess I should have tried it.  You just create a 'binding'
> > tag with a parameter that isn't declared for the component?
> >
> > --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


--
Pedro Viegas

Re: Validation

Posted by Martin Strand <ma...@entcap.se>.
Yep. I mostly use it to generate CSS classes dynamically:
<binding name="class" value="ognl:(itemActive ? 'active' : 'inactive')"/>

On Wed, 10 May 2006 21:40:20 +0300, Sam Gendler  
<sg...@ideasculptor.com> wrote:

> On 5/10/06, Martin Strand <ma...@entcap.se> wrote:
>> I often put informal parameters in my .page file, it seems to work fine.
>
> Hmph.  I guess I should have tried it.  You just create a 'binding'
> tag with a parameter that isn't declared for the component?
>
> --sam

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


Re: Validation

Posted by Sam Gendler <sg...@ideasculptor.com>.
On 5/10/06, Martin Strand <ma...@entcap.se> wrote:
> I often put informal parameters in my .page file, it seems to work fine.

Hmph.  I guess I should have tried it.  You just create a 'binding'
tag with a parameter that isn't declared for the component?

--sam

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


Re: Validation

Posted by Martin Strand <ma...@entcap.se>.
I often put informal parameters in my .page file, it seems to work fine.

Sam Gendler wrote:
> On 5/10/06, Martijn Hinten <ma...@cumquat.nl> wrote:
> The only thing I hate is when informal parameters are important to the
> function of the component, since, as far as I know, they must appear
> in the html file.  I really wish there were a way to bind informal
> parameters to a component from within a .page file, overriding any
> informal parameters of the same name that are in the .html template
> which may be necessary for layout in the unrendered page.  That way, I
> could put ALL of my parameter bindings in the .page file.


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


RE: Page files or annotations? [was: Validation]

Posted by James Carman <ja...@carmanconsulting.com>.
Well, without autowiring (it'll be in there soon), you have to use .page
files to inject service objects into your pages if you're not willing to use
annotations.  With autowiring, though, all you'll have to do is create a
"getter" for a property of the same type as one of the HiveMind services and
it'll be auto-wired for you.

-----Original Message-----
From: Paul Cantrell [mailto:cantrell@pobox.com] 
Sent: Wednesday, May 10, 2006 10:48 AM
To: Tapestry users
Subject: Re: Page files or annotations? [was: Validation]

I think Sam has it right: it depends.

In my development, I never write page files -- but we don't have any  
separate person devoted to the page design. That seems like the only  
compelling case left for the page files, but it is somewhat  
compelling: it keeps as much as possible out of the page file, so the  
designed can focus on the HTML and not have to tiptoe over so much  
extra baggage.

(One can of course use annotations to achieve that, too, but it  
requires declaring tons of getXyzComponent() methods that clutter up  
classes.)

However, without the separate designed role, I find the annotations  
approach keeps things much cleaner. Unless you're keen on keeping the  
templates as pared-down as possible, then, I'd recommend that.

In Tap 5, it sounds like things are moving towards annotations only.  
Hopefully 5 will reduce the verbosity of some of the common cases.

Cheers,

Paul

On May 10, 2006, at 7:49 AM, Sam Gendler wrote:

> On 5/10/06, Martijn Hinten <ma...@cumquat.nl> wrote:
>>  I have been wondering this for some time now: Is it the general  
>> consensus
>> to get rid of .page files and do all binding in the html (and  
>> injection via
>> annotations in the java classes)?
>>
>
> I think it depends on the size of your team and complexity of your
> app.  With a fairly large team, including one person devoted to
> layout, I prefer to keep all component declarations in .page files, so
> that the layout templates are as clean as possible and least likely to
> get screwed up by someone making edits without a clue about how
> tapestry works.  I've generally got nothing but jwcid attributes in my
> templates.  A simple macro in just about any editor will make it easy
> to switch between .page and .html files in a single keystroke or mouse
> click, so the complaint about having to switch files really isn't
> valid, to my mind.
>
> We also attempt to keep components in the same order in the .page file
> as they are used in the .html template.  It is a couple of minutes of
> developer time per page at the end of any release cycle on any pages
> that have gotten out of whack and it keeps things easy to find.  In
> fact, I have a macro in vim which will switch to a .page file and go
> to the same location as I am currently at, as a percentage of the file
> length, with two keystrokes.  Odds are usually good that I can see the
> component that I am looking for as soon as the other file is visible,
> and both files are so much more readable as a result.
>
> The only thing I hate is when informal parameters are important to the
> function of the component, since, as far as I know, they must appear
> in the html file.  I really wish there were a way to bind informal
> parameters to a component from within a .page file, overriding any
> informal parameters of the same name that are in the .html template
> which may be necessary for layout in the unrendered page.  That way, I
> could put ALL of my parameter bindings in the .page file.
>
> --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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



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


Re: Page files or annotations? [was: Validation]

Posted by Paul Cantrell <ca...@pobox.com>.
I think Sam has it right: it depends.

In my development, I never write page files -- but we don't have any  
separate person devoted to the page design. That seems like the only  
compelling case left for the page files, but it is somewhat  
compelling: it keeps as much as possible out of the page file, so the  
designed can focus on the HTML and not have to tiptoe over so much  
extra baggage.

(One can of course use annotations to achieve that, too, but it  
requires declaring tons of getXyzComponent() methods that clutter up  
classes.)

However, without the separate designed role, I find the annotations  
approach keeps things much cleaner. Unless you're keen on keeping the  
templates as pared-down as possible, then, I'd recommend that.

In Tap 5, it sounds like things are moving towards annotations only.  
Hopefully 5 will reduce the verbosity of some of the common cases.

Cheers,

Paul

On May 10, 2006, at 7:49 AM, Sam Gendler wrote:

> On 5/10/06, Martijn Hinten <ma...@cumquat.nl> wrote:
>>  I have been wondering this for some time now: Is it the general  
>> consensus
>> to get rid of .page files and do all binding in the html (and  
>> injection via
>> annotations in the java classes)?
>>
>
> I think it depends on the size of your team and complexity of your
> app.  With a fairly large team, including one person devoted to
> layout, I prefer to keep all component declarations in .page files, so
> that the layout templates are as clean as possible and least likely to
> get screwed up by someone making edits without a clue about how
> tapestry works.  I've generally got nothing but jwcid attributes in my
> templates.  A simple macro in just about any editor will make it easy
> to switch between .page and .html files in a single keystroke or mouse
> click, so the complaint about having to switch files really isn't
> valid, to my mind.
>
> We also attempt to keep components in the same order in the .page file
> as they are used in the .html template.  It is a couple of minutes of
> developer time per page at the end of any release cycle on any pages
> that have gotten out of whack and it keeps things easy to find.  In
> fact, I have a macro in vim which will switch to a .page file and go
> to the same location as I am currently at, as a percentage of the file
> length, with two keystrokes.  Odds are usually good that I can see the
> component that I am looking for as soon as the other file is visible,
> and both files are so much more readable as a result.
>
> The only thing I hate is when informal parameters are important to the
> function of the component, since, as far as I know, they must appear
> in the html file.  I really wish there were a way to bind informal
> parameters to a component from within a .page file, overriding any
> informal parameters of the same name that are in the .html template
> which may be necessary for layout in the unrendered page.  That way, I
> could put ALL of my parameter bindings in the .page file.
>
> --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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


Re: Validation

Posted by Sam Gendler <sg...@ideasculptor.com>.
On 5/10/06, Martijn Hinten <ma...@cumquat.nl> wrote:
>  I have been wondering this for some time now: Is it the general consensus
> to get rid of .page files and do all binding in the html (and injection via
> annotations in the java classes)?
>

I think it depends on the size of your team and complexity of your
app.  With a fairly large team, including one person devoted to
layout, I prefer to keep all component declarations in .page files, so
that the layout templates are as clean as possible and least likely to
get screwed up by someone making edits without a clue about how
tapestry works.  I've generally got nothing but jwcid attributes in my
templates.  A simple macro in just about any editor will make it easy
to switch between .page and .html files in a single keystroke or mouse
click, so the complaint about having to switch files really isn't
valid, to my mind.

We also attempt to keep components in the same order in the .page file
as they are used in the .html template.  It is a couple of minutes of
developer time per page at the end of any release cycle on any pages
that have gotten out of whack and it keeps things easy to find.  In
fact, I have a macro in vim which will switch to a .page file and go
to the same location as I am currently at, as a percentage of the file
length, with two keystrokes.  Odds are usually good that I can see the
component that I am looking for as soon as the other file is visible,
and both files are so much more readable as a result.

The only thing I hate is when informal parameters are important to the
function of the component, since, as far as I know, they must appear
in the html file.  I really wish there were a way to bind informal
parameters to a component from within a .page file, overriding any
informal parameters of the same name that are in the .html template
which may be necessary for layout in the unrendered page.  That way, I
could put ALL of my parameter bindings in the .page file.

--sam

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


Re: Validation

Posted by Rui Pacheco <ru...@gmail.com>.
Sounds simpler to me.
The only problem is, there is going to be a break between the implementation
and the documentation generally available on the web, which is almost all
related to Tapestry 3.0

If you do get rid of the .page files, there should be an effort to start
spreading through the web new examples of how to do things.

On 5/10/06, Martijn Hinten <ma...@cumquat.nl> wrote:
>
> I have been wondering this for some time now: Is it the general consensus
> to get rid of .page files and do all binding in the html (and injection via
> annotations in the java classes)?
>
>
> Rui Pacheco wrote:
>
> I was just wondering if I was going to have to write .page files for every
>
> .html page that required validation.
> Now that my blindness has been healed, I am happily adding validators=""
> to
> all tags on all my .html pages :D
>
> On 5/10/06, Pedro Viegas <pv...@gmail.com> <pv...@gmail.com> wrote:
>
>
> If you do all the binding in the .html template, and the class to page
> binding in the .application you don't need the .page in Tap4.
> Be more specific if this was not the answer you were looking for.
>
> Regards,
>
> On 5/9/06, Rui Pacheco <ru...@gmail.com> <ru...@gmail.com>wrote:
> >
> > Hi all
> >
> > In Tapestry 4 when doing validation, must I always place the binding tag
>
> > on
> > the page specification or can I do it on the .application file?
> >
> > I am asking because my application uses a fair amount of classes and I
> am
> > simply maping pages to classes through the .application file and I am
> > wondering if I'll have to create all the .page files now.
> >
> > --
> > Cumprimentos,
> > Rui Pacheco
> >
> >
>
>
> --
> Pedro Viegas
>
>
>
>
> --
> Cumprimentos,
> Rui Pacheco
>
>
> --
>
>
> *Cumquat Information Technology*
> De Dreef 19
> 3706 BR Zeist
> T +31 (0)30 - 6940490
> F +31 (0)10 - 6940499
>  http://www.cumquat.nl
>
>  martijn.hinten@cumquat.nl
> M +31 6 22 384 318
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For additional
> commands, e-mail: users-help@tapestry.apache.org
>



--
Cumprimentos,
Rui Pacheco

Re: Validation

Posted by Rui Pacheco <ru...@gmail.com>.
I was just wondering if I was going to have to write .page files for every
.html page that required validation.
Now that my blindness has been healed, I am happily adding validators="" to
all tags on all my .html pages :D

On 5/10/06, Pedro Viegas <pv...@gmail.com> wrote:
>
> If you do all the binding in the .html template, and the class to page
> binding in the .application you don't need the .page in Tap4.
> Be more specific if this was not the answer you were looking for.
>
> Regards,
>
> On 5/9/06, Rui Pacheco <ru...@gmail.com> wrote:
> >
> > Hi all
> >
> > In Tapestry 4 when doing validation, must I always place the binding tag
> > on
> > the page specification or can I do it on the .application file?
> >
> > I am asking because my application uses a fair amount of classes and I
> am
> > simply maping pages to classes through the .application file and I am
> > wondering if I'll have to create all the .page files now.
> >
> > --
> > Cumprimentos,
> > Rui Pacheco
> >
> >
>
>
> --
> Pedro Viegas
>
>


--
Cumprimentos,
Rui Pacheco

Re: Validation

Posted by Pedro Viegas <pv...@gmail.com>.
If you do all the binding in the .html template, and the class to page
binding in the .application you don't need the .page in Tap4.
Be more specific if this was not the answer you were looking for.

Regards,

On 5/9/06, Rui Pacheco <ru...@gmail.com> wrote:
>
> Hi all
>
> In Tapestry 4 when doing validation, must I always place the binding tag
> on
> the page specification or can I do it on the .application file?
>
> I am asking because my application uses a fair amount of classes and I am
> simply maping pages to classes through the .application file and I am
> wondering if I'll have to create all the .page files now.
>
> --
> Cumprimentos,
> Rui Pacheco
>
>


--
Pedro Viegas