How to map a html field to a complicated property of page class in Tapestry5.0.4

2007-05-20 Thread Allen Guo
Hi All,
There is a page class below.
// ProductDetail.java
private Goods _goods;
public void setGoods(Goods g) {
this._goods = g;
}
public Goods getGoods() {
Goods goods = new Goods();
goods.setDescription(Pure Cotton TShirt);
goods.setName(Pumpkin);
this._goods = goods;
}
...

// ProductDetail.html
input t:type=TextField t:id=goods.name class=form style=width:
220px; type=text /

I just want to map the text field to goods.name . Can I do it like above?
If not, what should I do?




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



Re: How to load a image dynamiclly in tapestry5.0.4

2007-05-20 Thread petros

This is how I used Asset for an image in T5.0.4
Java class
@Inject
@Path(context:images/banners/new_logo.jpg)
private Asset logoImage;

HTML code
prop:logoImage 

Petros


Allen Guo wrote:
 
 Hi All,
 
 I want to show the ProductDetail page with product image. It looks like
  p_001.jpg .
 You know, every product has different image name,so I need to pass the
 string 'p_001.jpg' to the corresponding page.
 As result the img tag should look like  ${product.image}  or
 I can use Asset to do it.
 
 But I tried to do it using the first approach, exception occured.
 And I don't know how to the second approach.
 Can anyone give me an idea?
 
 Thank in advance
 Allen Guo
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-load-a-image-dynamiclly-in-tapestry5.0.4-tf3784430.html#a10705166
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: How to load a image dynamiclly in tapestry5.0.4

2007-05-20 Thread petros

This is how I used Asset for an image in T5.0.4

Java class
@Inject
@Path(context:images/banners/new_logo.jpg)
private Asset logoImage;

HTML code 
imgimg  t:type=Any src=prop:logoImage  width=30% height=92
border=0 /

Petros


Allen Guo wrote:
 
 Hi All,
 
 I want to show the ProductDetail page with product image. It looks like
  p_001.jpg .
 You know, every product has different image name,so I need to pass the
 string 'p_001.jpg' to the corresponding page.
 As result the img tag should look like  ${product.image}  or
 I can use Asset to do it.
 
 But I tried to do it using the first approach, exception occured.
 And I don't know how to the second approach.
 Can anyone give me an idea?
 
 Thank in advance
 Allen Guo
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-load-a-image-dynamiclly-in-tapestry5.0.4-tf3784430.html#a10705193
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T4.1.1 Validation issue - clientside + decoration works, but getHasErrors is false?

2007-05-20 Thread Jan Vissers
I must be missing something very trivial here.
I have a form with some 'required' validation specified, in the onSubmit I
check for getHasErrors()==true. The strange thing is that this is always
false, but the form *does* contain errors. What's more - the fields are
properly decorated as having errors, and when I switch on client side
validation - these errors are (also) picked up.

So... why is it that getHasErrors() remains false?

Thanks,
-J.


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



May I use the tapestry-ioc other packages?

2007-05-20 Thread Donyee

I try to use the Tapestry-ioc  in the other packages,not just in the
.pages.* package.
Does it support this?
I try to use @Inject in my domain.service.Impl.AccountServiceImpl.java
code: @Inject  private AccountDao dao;
but it doesn't work!

Any suggestion?



徐 依伟


Re: May I use the tapestry-ioc other packages?

2007-05-20 Thread Howard Lewis Ship

You can create modules and use the IoC annotations to build services.

However, the magic injection into private fields is part of Tapestry's
very aggressive bytecode enhancement of component classes. It's not
available for ordinary classes (I'd tend to call them data- or
model-classes) outside of the controlled Tapestry packages (.pages,
.components and .base).

Basically, once Tapestry gets done working over a component class, it isn't
good outside of Tapestry, it isn't even instantiable.

For services, you place an
org.apache.tapestry.ioc.annotations.Injectannotation on a parameter of
your service implementation constructor.  Or
more likey, don't bother to annotate and Tapestry IoC will select the
correct service or object to inject automatically.

On 5/20/07, Donyee [EMAIL PROTECTED] wrote:


I try to use the Tapestry-ioc  in the other packages,not just in the
.pages.* package.
Does it support this?
I try to use @Inject in my domain.service.Impl.AccountServiceImpl.java
code: @Inject  private AccountDao dao;
but it doesn't work!

Any suggestion?



徐 依伟





--
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


Re: just posted some thoughts on tapestry and its future

2007-05-20 Thread Howard Lewis Ship

And they are very good thoughts.

There won't be a Tapestry 6.  The design of Tapestry 5 is to create the
stability you call for in your blog posting.

The essence of Tapestry for me is that there is a fundamental germ of an
idea encapsulated in the code and the design, and it's a powerful and
compelling idea.  Tapestry 1 through Tapestry 4 approached that idea and
made it possible for many users to leverage it, but minor flaws in the
implementation grew overwhelming, especially in terms of coloring outside
the lines.

My skill as a designer, as a coder, and (I hope) as an evangelist have all
grown over the last few years, possibly as I've been exposed to other great
developers (via the No Fluff Just Stuff conferences) and, through teaching
Tapesry, to more actual users.  My goal is to have something overwhelmingly
compelling for new users, who are suffering under Struts and JSF, and for
existing users (who need to make a transition from T4 to T5).  The feedback
I've been getting from my actual, paying clients is very positive, which
keeps me motivated.

On 5/19/07, Warner Onstine [EMAIL PROTECTED] wrote:


This is something that I've been thinking about for a while and wrote
a blog post about why I think Tapestry hasn't seen greater adoption,
I would like to encourage all who are interested in commenting (or
just reading) to visit my blog.

I would like this to be a constructive discussion, so please no
flames ;-).

http://jroller.com/page/WarnerOnstine?entry=why_hasn_t_tapestry_been

-warner

Warner Onstine - Programmer/Author
New book! Tapestry 101 available at http://sourcebeat.com/books/
tapestrylive.html
[EMAIL PROTECTED]
http://warneronstine.com/blog




-
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


Re: How to load a image dynamiclly in tapestry5.0.4

2007-05-20 Thread Howard Lewis Ship

In order to answer this question, some background is needed.

If you know the product's id (whatever you use, where it's  SKU number or a
surrogate key) ... what is the exact process from going from that to a URL
suitable for an img tag?

That is ... are the images stored in the database?  Or are they on the file
system somewhere?  If they are files on the file system, are those files
mapped to a client-visible URL?

In the latter case, you can do something like:

img t:id=productImage src=prop:productImageURL/

public String getProductImageURL() {
 return http://static.myco.com/product-images/; + _productId + .gif;
}



Assigning a t:id to a tag without specifying a component type creates an Any
component, a component that just renders whatever tag and informal
parameters you provide it.  Here wer'e linking that to some Java code in the
corresponding page or component that computes the URL of the product based
on an instance variable.  Probably your example is more complicated, but you
get the idea.

There's another approach used when the data is inside the database, but we
can dive into that if the above solution is insufficient.

Assets are useful for accessing resources inside the web application
context, or on the classpath, and includes logic related to localization ...
but it is not always appropriate when accessing resources that are well
outside the web application itself.

On 5/19/07, Allen Guo [EMAIL PROTECTED] wrote:


Hi All,

I want to show the ProductDetail page with product image. It looks like
img src=p_001.jpg /.
You know, every product has different image name,so I need to pass the
string 'p_001.jpg' to the corresponding page.
As result the img tag should look like img src=${product.image}/ or
I can use Asset to do it.

But I tried to do it using the first approach, exception occured.
And I don't know how to the second approach.
Can anyone give me an idea?

Thank in advance
Allen Guo


-
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


Re: Is onActivate a robust place for authentication?

2007-05-20 Thread Bill Holloway

Sorry, everybody, I should have mentioned that I'm in T5.  Looking for
a solution.

Bill

On 5/18/07, Martino Piccinato [EMAIL PROTECTED] wrote:

I think what you are looking for is interface PageValidateListener

http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/event/PageValidateListener.html

it's thought just for this kind of things afaik.

On 5/18/07, Eric Chatellier [EMAIL PROTECTED] wrote:

 2007/5/18, Bill Holloway [EMAIL PROTECTED]:
  I'm not sure yet how to integrate ACEGI, but I can look at an ASO in
  onActivate for a page.  Is returning a page name from onActivate() a
  robust solution for basic user authentication?
 
  Bill

 I bill

 I'm interested by the answer too...

 Where can we put redirect to login form (for exmple) if the user has
 not logged in ?

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






--
The future is here.  It's just not evenly distributed yet.

-- Traditional

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



Re: Is onActivate a robust place for authentication?

2007-05-20 Thread Bill Holloway

Yeah, that's how I'm doing this now.  Having a Tapestry annotation
like @Secure that invokes your pipeline contribution sounds the most
solid.

Bill

On 5/18/07, Howard Lewis Ship [EMAIL PROTECTED] wrote:

For the meantime, an activate event handler method (in a base class) is
how I've envisioned authentication.

However, I want to open up a kind of pipeline between the Dispatcher and the
PageLinkHandler that can be injected, so that you can do this kind of
operation across the entire application.

On 5/17/07, Bill Holloway [EMAIL PROTECTED] wrote:

 I'm not sure yet how to integrate ACEGI, but I can look at an ASO in
 onActivate for a page.  Is returning a page name from onActivate() a
 robust solution for basic user authentication?

 Bill

 --
 The future is here.  It's just not evenly distributed yet.

  -- Traditional

 -
 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




--
The future is here.  It's just not evenly distributed yet.

-- Traditional

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



Re: General Tapestry Question - File permissions

2007-05-20 Thread Peter Dawn

am not sure if i follow. so how can i fix this. i have a tomcat server
running. so i have to `edit something in the tomcat settings? and if
yes, could you provide some further info.

thanks.

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



looking for such a component

2007-05-20 Thread Heping Zhang

hi, all, I'm a novice to tapestry. And I wonder whether there is such a
compenont. Generally, it acts like a table. But while table presents content
this way:
-
row 1
-
row 2
-
row 3
-
row 4
-
I am looking for a component presents content this way:
-+--
row 1  |  row 2
-+--
row 3  |  row 4
-+--
it puts the contest into grids, not rows. Is there any conponents like this?
thank you!


RE: looking for such a component

2007-05-20 Thread Jonathan Barker


Have you considered a simple @For and then use CSS and display:block,
float:left to generate the positioning?

It looks like you are wanting a multi-column display of a list, rather than
a real table.  Play around with 
ul class=mylist
lirow 1/li
lirow 2/li
... etc.
/ul

And in css:
ul.mylist li {
display:block;
float:left;
width: 50px;
}

You will render the list horizontally until you hit a containing element, so
if you have the list inside a fixed-width div, then you can limit the
number horizontally.  You will also need to play with padding and margins in
your css.


 -Original Message-
 From: Heping Zhang [mailto:[EMAIL PROTECTED]
 Sent: Sunday, May 20, 2007 8:58 PM
 To: users@tapestry.apache.org
 Subject: looking for such a component
 
 hi, all, I'm a novice to tapestry. And I wonder whether there is such a
 compenont. Generally, it acts like a table. But while table presents
 content
 this way:
 -
 row 1
 -
 row 2
 -
 row 3
 -
 row 4
 -
 I am looking for a component presents content this way:
 -+--
 row 1  |  row 2
 -+--
 row 3  |  row 4
 -+--
 it puts the contest into grids, not rows. Is there any conponents like
 this?
 thank you!


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



Re: looking for such a component

2007-05-20 Thread Heping Zhang

hi, Jonathan, thank you. That's what I am trying to do now. As I have ever
used JSF and it has a table component which can designate its style to
ask it display rows as grids, I do know whether tap has such a component,
so I post this email. Still thanks for your help. Your demo helps me with
this For component!


Re: How to load a image dynamiclly in tapestry5.0.4

2007-05-20 Thread 蝈蝈龙

Thank you very much. My image file is put on file system. It works now.
But I feel that it's not flexible.
I wrote the img tag like
img t:id=productImage src=prop:productImageURL/
But I want write it like
img t:id=productImage src=/products_images/prop:productImageURL/

You see, there is a folder prefix for the src property of img tag above
For this efffect, what should I do?



2007/5/21, Howard Lewis Ship [EMAIL PROTECTED]:


In order to answer this question, some background is needed.

If you know the product's id (whatever you use, where it's  SKU number or
a
surrogate key) ... what is the exact process from going from that to a URL
suitable for an img tag?

That is ... are the images stored in the database?  Or are they on the
file
system somewhere?  If they are files on the file system, are those files
mapped to a client-visible URL?

In the latter case, you can do something like:

img t:id=productImage src=prop:productImageURL/

public String getProductImageURL() {
  return http://static.myco.com/product-images/; + _productId + .gif;
}



Assigning a t:id to a tag without specifying a component type creates an
Any
component, a component that just renders whatever tag and informal
parameters you provide it.  Here wer'e linking that to some Java code in
the
corresponding page or component that computes the URL of the product based
on an instance variable.  Probably your example is more complicated, but
you
get the idea.

There's another approach used when the data is inside the database, but we
can dive into that if the above solution is insufficient.

Assets are useful for accessing resources inside the web application
context, or on the classpath, and includes logic related to localization
...
but it is not always appropriate when accessing resources that are well
outside the web application itself.

On 5/19/07, Allen Guo [EMAIL PROTECTED] wrote:

 Hi All,

 I want to show the ProductDetail page with product image. It looks like
 img src=p_001.jpg /.
 You know, every product has different image name,so I need to pass the
 string 'p_001.jpg' to the corresponding page.
 As result the img tag should look like img src=${product.image}/ or
 I can use Asset to do it.

 But I tried to do it using the first approach, exception occured.
 And I don't know how to the second approach.
 Can anyone give me an idea?

 Thank in advance
 Allen Guo


 -
 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



Re: How to load a image dynamiclly in tapestry5.0.4

2007-05-20 Thread Howard Lewis Ship

Wait for 5.0.5 ... I'm working on code for that right now, so you'll be able
to write:

img src=/products_images/${productImageURL}/

Still, from a maintainability situation, I would prefer that the complete
URL come from the Java code side; if /product_images ever becomes, say,
/images/catalog some day, you may be able to fix it across your entire
application in exactly one place.  That's the Dont Repeat Yourself principle
and your example jumps out at me as a potential problem.

On 5/20/07, 蝈蝈龙 [EMAIL PROTECTED] wrote:


Thank you very much. My image file is put on file system. It works now.
But I feel that it's not flexible.
I wrote the img tag like
img t:id=productImage src=prop:productImageURL/
But I want write it like
img t:id=productImage src=/products_images/prop:productImageURL/

You see, there is a folder prefix for the src property of img tag above
For this efffect, what should I do?



2007/5/21, Howard Lewis Ship [EMAIL PROTECTED]:

 In order to answer this question, some background is needed.

 If you know the product's id (whatever you use, where it's  SKU number
or
 a
 surrogate key) ... what is the exact process from going from that to a
URL
 suitable for an img tag?

 That is ... are the images stored in the database?  Or are they on the
 file
 system somewhere?  If they are files on the file system, are those files
 mapped to a client-visible URL?

 In the latter case, you can do something like:

 img t:id=productImage src=prop:productImageURL/

 public String getProductImageURL() {
   return http://static.myco.com/product-images/; + _productId + .gif;
 }



 Assigning a t:id to a tag without specifying a component type creates an
 Any
 component, a component that just renders whatever tag and informal
 parameters you provide it.  Here wer'e linking that to some Java code in
 the
 corresponding page or component that computes the URL of the product
based
 on an instance variable.  Probably your example is more complicated, but
 you
 get the idea.

 There's another approach used when the data is inside the database, but
we
 can dive into that if the above solution is insufficient.

 Assets are useful for accessing resources inside the web application
 context, or on the classpath, and includes logic related to localization
 ...
 but it is not always appropriate when accessing resources that are well
 outside the web application itself.

 On 5/19/07, Allen Guo [EMAIL PROTECTED] wrote:
 
  Hi All,
 
  I want to show the ProductDetail page with product image. It looks
like
  img src=p_001.jpg /.
  You know, every product has different image name,so I need to pass the
  string 'p_001.jpg' to the corresponding page.
  As result the img tag should look like img src=${product.image}/
or
  I can use Asset to do it.
 
  But I tried to do it using the first approach, exception occured.
  And I don't know how to the second approach.
  Can anyone give me an idea?
 
  Thank in advance
  Allen Guo
 
 
  -
  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






--
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