[T5] Looping over strings

2007-06-09 Thread Hilco Wijbenga

Hi all,

I've got the following in my Init.html:


${subdirectory}


which nicely generates a list of links. The subdirectory parameter is
a string (i.e. directory.options is a List, a list of
subdirectories).

In Init.java I have

public void onActionFromSubdir(final String subdirectory) {
System.out.println("subdirectory='" + subdirectory + "'");
}

which gets called when I click on one of the above links. However, the
subdirectory parameter is always empty (""). In the T5 tutorial with
integers this worked perfectly. What am I doing wrong?

On top of that I'm getting a warning:

[WARN] ResourceCache Alias request of
'file:/...dirs.../src/main/webapp/init.subdir/the/sub/dir' for
'file:/...dirs.../src/main/webapp/init.subdir/the/sub/dir'

(when selecting /the/sub/dir link). How can I suppress this?

Cheers,
Hilco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: About component 'loop' usage in T5.0.4

2007-06-09 Thread Allen Guo
Can anybody give some suggestion?

Allen Guo 写道:
> Hi All,
>
> If I use loop component in html template like this
> 
> ${_sort.name}
> 
>
> I have to define the property in corresponding page class like this
> public class SortList {
> .
> private Sort sort;
> private List sorts;
> public Sort getSort() {
> return sort;
> }
>
> public void setSort(Sort sort) {
> this.sort = sort;
> }
> .
> }
> It seems that the 'sort' must be defined in page class. It's so terrible.:(
> If I can remove the property 'sort' from page class like T4.1, it will
> be great.
>
>
> Thanks
> Allen Guo
>
>   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can I use javascript in html template with TP5.0.4

2007-06-09 Thread Allen Guo
I tried it.But it still don't work.
Even it can work, I think this is also not good.
Becuase it make writting javascript in html template becomes so complex.

I remember in T4, I can add a same .script file with page class then
write javascript in it.
Can I do it like above in T5?



Timo Hillerns 写道:
> hi allen,
> replace your '<' character with '<' in line 19 should fix it.
>
> regards,
> timo
>
> Allen Guo wrote:
>   
>> Hi All,
>>
>> I use javascript in my html template file like this.
>> 15   

Re: Hackish(?) Workaround for Entities In Templates

2007-06-09 Thread D&J Gredler

If you specify a doctype in your templates (like XHTML 1.0 Strict), you can
use entities like ©


http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

http://www.w3.org/1999/xhtml"; xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
   Copyright © Me



On 6/8/07, Steven Coco <[EMAIL PROTECTED]> wrote:


I just implemented a set of properties in WEB-INF/Application.properties.
They
look like this:

# HTML entities:
entity.copy: ©
entity.trade: ™
...

Now in templates I can "use" them like so:



Such is life.

Ciao.
-Steven Coco.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Daniel Gredler
http://daniel.gredler.net/


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Martin Grotzke
Does this enable us to use hibernate validator in our business layer
that is completely independent from tapestry?
Hibernate validator is right now our favorite option for validation,
but it might be that we have to use an own implementation - we're still
evaluating.

What we're sure about is that in the business layer validation is
performed and that for each validation error details are provided
that should allow the presentation layer to map this information
to a specific field/element.

IMHO a good solution for this use case is recording the error with
the element name, without being forced to have a Field for each
element.

What do you think?

Cheers,
Martin



On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
> That's true ... though I expect to make Tapestry smarter about
> recognizing the Hibernate annotations and producing automatic client-
> and server-side validation for them.
> 
> On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > We want to do validation in the business layer (with hibernate
> > validator) and get back an exception with a list of invalid values,
> > where each invalid value provides the property path.
> >
> > Then we want to have a mapping of the property path to the element
> > name and record an error for this on the tapestry form.
> >
> > The value is to be able to use hibernate validator in our business
> > layer and not to be forced to define each Field in the page class,
> > which is better in terms of performance and saves unnecessary work.
> >
> > Cheers,
> > Martin
> >
> >
> > On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
> > > I don't see the value ... how would you obtain the element name
> > > without getting the field itself; and if you've injected the field (to
> > > invoke getElementName() ), then why wouldn't you just pass the field
> > > to the tracker?
> > >
> > > Convince me there's something actually missing.
> > >
> > > On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > >
> > > > right now there's a recordError(Field,String) method for storing
> > > > errors for elements of the page.
> > > >
> > > > We would like to have also a method recordError(String,String) where
> > > > the first parameter is the element name.
> > > >
> > > > The ValidationTrackerImpl seems to use only the elementName of the
> > > > Field:
> > > >
> > > > private FieldTracker get(Field field)
> > > > {
> > > > String key = field.getElementName();
> > > >
> > > > refreshFieldToTracker();
> > > >
> > > > FieldTracker result = InternalUtils.get(_fieldToTracker, key);
> > > >
> > > > if (result == null)
> > > > result = new FieldTracker(key);
> > > >
> > > > return result;
> > > > }
> > > >
> > > > so an additional method seems to be not a big issue.
> > > >
> > > > Would this be possible to add to T5? Shall we submit a patch for this
> > > > here in the list or enter an issue?
> > > >
> > > > Thanx && cheers,
> > > > Martin
> > > >
> > > >
> > > > --
> > > > Martin Grotzke
> > > > Dipl.-Inf.
> > > >
> > > > freiheit.com technologies gmbh
> > > > Straßenbahnring 22 / 20251 Hamburg, Germany
> > > > fon   +49 (0)40 / 890584-0
> > > > fax   +49 (0)40 / 890584-20
> > > > HRB Hamburg 70814
> > > >
> > > > eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
> > > > Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
> > > >
> > > >
> > >
> > >
> > --
> > Martin Grotzke
> > http://www.javakaffee.de/blog/
> >
> >
> 
> 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Howard Lewis Ship

That's true ... though I expect to make Tapestry smarter about
recognizing the Hibernate annotations and producing automatic client-
and server-side validation for them.

On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:

We want to do validation in the business layer (with hibernate
validator) and get back an exception with a list of invalid values,
where each invalid value provides the property path.

Then we want to have a mapping of the property path to the element
name and record an error for this on the tapestry form.

The value is to be able to use hibernate validator in our business
layer and not to be forced to define each Field in the page class,
which is better in terms of performance and saves unnecessary work.

Cheers,
Martin


On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
> I don't see the value ... how would you obtain the element name
> without getting the field itself; and if you've injected the field (to
> invoke getElementName() ), then why wouldn't you just pass the field
> to the tracker?
>
> Convince me there's something actually missing.
>
> On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > right now there's a recordError(Field,String) method for storing
> > errors for elements of the page.
> >
> > We would like to have also a method recordError(String,String) where
> > the first parameter is the element name.
> >
> > The ValidationTrackerImpl seems to use only the elementName of the
> > Field:
> >
> > private FieldTracker get(Field field)
> > {
> > String key = field.getElementName();
> >
> > refreshFieldToTracker();
> >
> > FieldTracker result = InternalUtils.get(_fieldToTracker, key);
> >
> > if (result == null)
> > result = new FieldTracker(key);
> >
> > return result;
> > }
> >
> > so an additional method seems to be not a big issue.
> >
> > Would this be possible to add to T5? Shall we submit a patch for this
> > here in the list or enter an issue?
> >
> > Thanx && cheers,
> > Martin
> >
> >
> > --
> > Martin Grotzke
> > Dipl.-Inf.
> >
> > freiheit.com technologies gmbh
> > Straßenbahnring 22 / 20251 Hamburg, Germany
> > fon   +49 (0)40 / 890584-0
> > fax   +49 (0)40 / 890584-20
> > HRB Hamburg 70814
> >
> > eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
> > Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
> >
> >
>
>
--
Martin Grotzke
http://www.javakaffee.de/blog/





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Dynamic components (Dynamic Tiles)

2007-06-09 Thread Howard Lewis Ship

Here we go again ...

Tapestry pages a very structured, in effect, static. This is core to
Tapestry's approach towards scalability and maintenance of server side
state.

However, even though the page structure is static, the order in which
components render is really under your control.  Further, you can mix
and match rendering of components from different pages.

A render phase method is allowed to return a Block or a component or
anything else that knows how to render, and that object will then take
control of the rendering.

This is how the BeanEditForm and Grid components operate; there are
extra pages that contain components for different types of edittable
data, and the BeanEditForm or Grid just chooses the correct Block of
components to render based on the type of property being editted.

I hope to flesh this out in a more advanced chapter of the tutorial.
I'm currently converting it from PDF to HTML to allow more people to
contribute to it.

On 6/9/07, Vic Cekvenich <[EMAIL PROTECTED]> wrote:

One thing I did in Struts is decide which tile to load for of my users
into their layout.

How do I in T5 have different layouts and different components load?
Normally in session I from DB load layout name and what components
(formerly tiles) go into each "zone" of the layout.
I would do an expression on a page to load them.
How would I do similar to tiles in T5?

.V

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 endorsement

2007-06-09 Thread Howard Lewis Ship

That's great to hear.  I agree that the documentation needs a little
work about layout, we're relying on the crutch of saying "use the
standard Maven layout".  Of course, there's nothing in Tapestry that
requires that exact layout.

There has certainly been some interest from a few different directions
on a Tapestry 5 book!

On 6/9/07, Vic Cekvenich <[EMAIL PROTECTED]> wrote:

I did 1st book on Struts, @ 2 years ahead of any other.

Today I tried T5 and I want to say it rocks and is much simpler then
other frameworks.
I will do my new projects in it.

I saw the videos, and my only are of improvement is that the T5 Videos
are Maven centric and alien to us Ant folk. How we lay out our project
should be our choice.
Looking forward to learning more on T5 w/ Ajax (Yahoo Library).

Thanks Howard and team!

Vic Cekvenich
CTO, Vendio.com, CTO Delio.com
Past founder: Pointcast.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: Dynamic components (Dynamic Tiles)

2007-06-09 Thread Vic Cekvenich
One thing I did in Struts is decide which tile to load for of my users 
into their layout.


How do I in T5 have different layouts and different components load? 
Normally in session I from DB load layout name and what components 
(formerly tiles) go into each "zone" of the layout.

I would do an expression on a page to load them.
How would I do similar to tiles in T5?

.V

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 endorsement

2007-06-09 Thread Vic Cekvenich

I did 1st book on Struts, @ 2 years ahead of any other.

Today I tried T5 and I want to say it rocks and is much simpler then 
other frameworks.

I will do my new projects in it.

I saw the videos, and my only are of improvement is that the T5 Videos 
are Maven centric and alien to us Ant folk. How we lay out our project 
should be our choice.

Looking forward to learning more on T5 w/ Ajax (Yahoo Library).

Thanks Howard and team!

Vic Cekvenich
CTO, Vendio.com, CTO Delio.com
Past founder: Pointcast.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Martin Grotzke
We want to do validation in the business layer (with hibernate
validator) and get back an exception with a list of invalid values,
where each invalid value provides the property path.

Then we want to have a mapping of the property path to the element
name and record an error for this on the tapestry form.

The value is to be able to use hibernate validator in our business
layer and not to be forced to define each Field in the page class,
which is better in terms of performance and saves unnecessary work.

Cheers,
Martin


On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
> I don't see the value ... how would you obtain the element name
> without getting the field itself; and if you've injected the field (to
> invoke getElementName() ), then why wouldn't you just pass the field
> to the tracker?
> 
> Convince me there's something actually missing.
> 
> On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > right now there's a recordError(Field,String) method for storing
> > errors for elements of the page.
> >
> > We would like to have also a method recordError(String,String) where
> > the first parameter is the element name.
> >
> > The ValidationTrackerImpl seems to use only the elementName of the
> > Field:
> >
> > private FieldTracker get(Field field)
> > {
> > String key = field.getElementName();
> >
> > refreshFieldToTracker();
> >
> > FieldTracker result = InternalUtils.get(_fieldToTracker, key);
> >
> > if (result == null)
> > result = new FieldTracker(key);
> >
> > return result;
> > }
> >
> > so an additional method seems to be not a big issue.
> >
> > Would this be possible to add to T5? Shall we submit a patch for this
> > here in the list or enter an issue?
> >
> > Thanx && cheers,
> > Martin
> >
> >
> > --
> > Martin Grotzke
> > Dipl.-Inf.
> >
> > freiheit.com technologies gmbh
> > Straßenbahnring 22 / 20251 Hamburg, Germany
> > fon   +49 (0)40 / 890584-0
> > fax   +49 (0)40 / 890584-20
> > HRB Hamburg 70814
> >
> > eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
> > Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
> >
> >
> 
> 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Howard Lewis Ship

I don't see the value ... how would you obtain the element name
without getting the field itself; and if you've injected the field (to
invoke getElementName() ), then why wouldn't you just pass the field
to the tracker?

Convince me there's something actually missing.

On 6/9/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:

Hello,

right now there's a recordError(Field,String) method for storing
errors for elements of the page.

We would like to have also a method recordError(String,String) where
the first parameter is the element name.

The ValidationTrackerImpl seems to use only the elementName of the
Field:

private FieldTracker get(Field field)
{
String key = field.getElementName();

refreshFieldToTracker();

FieldTracker result = InternalUtils.get(_fieldToTracker, key);

if (result == null)
result = new FieldTracker(key);

return result;
}

so an additional method seems to be not a big issue.

Would this be possible to add to T5? Shall we submit a patch for this
here in the list or enter an issue?

Thanx && cheers,
Martin


--
Martin Grotzke
Dipl.-Inf.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Martin Grotzke
Hello,

right now there's a recordError(Field,String) method for storing
errors for elements of the page.

We would like to have also a method recordError(String,String) where
the first parameter is the element name.

The ValidationTrackerImpl seems to use only the elementName of the
Field:

private FieldTracker get(Field field)
{
String key = field.getElementName();

refreshFieldToTracker();

FieldTracker result = InternalUtils.get(_fieldToTracker, key);

if (result == null)
result = new FieldTracker(key);

return result;
}

so an additional method seems to be not a big issue.

Would this be possible to add to T5? Shall we submit a patch for this
here in the list or enter an issue?

Thanx && cheers,
Martin


-- 
Martin Grotzke
Dipl.-Inf.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


signature.asc
Description: This is a digitally signed message part


Re: How can I use javascript in html template with TP5.0.4

2007-06-09 Thread Timo Hillerns
hi allen,
replace your '<' character with '<' in line 19 should fix it.

regards,
timo

Allen Guo wrote:
> Hi All,
>
> I use javascript in my html template file like this.
> 15

How can I use javascript in html template with TP5.0.4

2007-06-09 Thread Allen Guo
Hi All,

I use javascript in my html template file like this.
15  

Re: T5: banner message above form errors

2007-06-09 Thread Adam Zimowski

Oooo.. Thank you Howard. I've looked in the wrong place.

On 6/9/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:

The text is a function of the Errors component (which is embedded
inside the BeanEditForm).

On 6/9/07, Adam Zimowski <[EMAIL PROTECTED]> wrote:
> No answer? I guess at least it'd be good to know if this isn't
> implemented in T5. Anyway, as a work around I've spit out the
> unexpected error below the form without using form error mechanism.
>
> On 6/7/07, Adam Zimowski <[EMAIL PROTECTED]> wrote:
> > Hello,
> > Is there a way to customize the default banner "You must correct the
> > following errors before you may continue." message? I'd like to change
> > this banner dynamically depending on the error. Specifically, I'd like
> > to do something like this in my page class:
> >
> > try {
> >  // deal with form input
> > }
> > catch(SQLException sqle) {
> >   // _form.setSomehowDefaultBanner("Unexpected Error:");
> >   _form.recordError(sqle.getMessage());
> > }
> >
> > Regards,
> > -adam
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: banner message above form errors

2007-06-09 Thread Howard Lewis Ship

The text is a function of the Errors component (which is embedded
inside the BeanEditForm).

On 6/9/07, Adam Zimowski <[EMAIL PROTECTED]> wrote:

No answer? I guess at least it'd be good to know if this isn't
implemented in T5. Anyway, as a work around I've spit out the
unexpected error below the form without using form error mechanism.

On 6/7/07, Adam Zimowski <[EMAIL PROTECTED]> wrote:
> Hello,
> Is there a way to customize the default banner "You must correct the
> following errors before you may continue." message? I'd like to change
> this banner dynamically depending on the error. Specifically, I'd like
> to do something like this in my page class:
>
> try {
>  // deal with form input
> }
> catch(SQLException sqle) {
>   // _form.setSomehowDefaultBanner("Unexpected Error:");
>   _form.recordError(sqle.getMessage());
> }
>
> Regards,
> -adam
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: banner message above form errors

2007-06-09 Thread Adam Zimowski

No answer? I guess at least it'd be good to know if this isn't
implemented in T5. Anyway, as a work around I've spit out the
unexpected error below the form without using form error mechanism.

On 6/7/07, Adam Zimowski <[EMAIL PROTECTED]> wrote:

Hello,
Is there a way to customize the default banner "You must correct the
following errors before you may continue." message? I'd like to change
this banner dynamically depending on the error. Specifically, I'd like
to do something like this in my page class:

try {
 // deal with form input
}
catch(SQLException sqle) {
  // _form.setSomehowDefaultBanner("Unexpected Error:");
  _form.recordError(sqle.getMessage());
}

Regards,
-adam



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 Where to store CSS/JS files and images

2007-06-09 Thread Erik Vullings

Hi Marcus,

It's just a JavaBean, representing a building or room, and some getters and
setters.

Cheers
Erik


On 6/9/07, Marcus <[EMAIL PROTECTED]> wrote:


Hi Erik,

what about (nl.tno.secureit2.data.PhysicalObject)?

Thanks

Marcus