Re: T5:Tiles?

2007-08-29 Thread Josh Canfield
On 8/29/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 if I use the approach quoted below, I got an error like this from runtime
 console, and the title was not set:

 [ERROR] Login Embedded component(s) layout are defined within component
 class org.sample.t5.pages.Login, but are not present in the component
 template.


The error message says that you don't have the component in your template.
You can't inject the component into your class if it doesn't exist in the
template If you do have the layout component in the template then try adding
an t:id=layout to the template.


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.


Re: T5:Tiles?

2007-08-29 Thread Angelo Chen

Hi Josh,

This error is interesting, it comes out only once even you have several
pages using the approach 2 and it works with the error around. adding
t:id=layout' eliminate the error message. probably a minor problem in the
error reporting?

A.C.


Josh Canfield-2 wrote:
 
 On 8/29/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 if I use the approach quoted below, I got an error like this from runtime
 console, and the title was not set:

 [ERROR] Login Embedded component(s) layout are defined within component
 class org.sample.t5.pages.Login, but are not present in the component
 template.
 
 
 The error message says that you don't have the component in your template.
 You can't inject the component into your class if it doesn't exist in the
 template If you do have the layout component in the template then try
 adding
 an t:id=layout to the template.
 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12399469
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: T5:Tiles?

2007-08-29 Thread Angelo Chen

Hi Josh,

When i tested in the localhost, the speed is fast, so that behavor is not
noticeable, but when I put the war file in a slow server in the net, I can
notice that in Safari, not in IE and FireFox. I believe I have put those
pages/components in the right places. I did not notice reloading of the
page, but the change of url only.

A.C.


Josh Canfield wrote:
 
 you will see in the address field first:
 http://localhost/sample/layout.forums
 then it goes back to http://localhost/sample/forums

 but for Firefox or IE either in mac or windows, the layout.forums  
 will not
 be shown, only the final one.
 
 I've tried it in Safari on my Mac and I've never seen that behavior.  
 I don't believe that another request is generated simply by loading  
 the page. Can you provide more information about what you are doing?  
 Are your components and pages in the right folders?
 
 
 TheDailyTube.com. The best new videos on the internet delivered fresh  
 to your inbox.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12399480
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: T5:Tiles?

2007-08-28 Thread Angelo Chen

Hi Josh,

I tried to folow following method, but not working:

my Layout.java like this:

public class Layout {

@Parameter
private Block _sidebarContent;

public Block getSidebarContent() {
return _sidebarContent;
}

public void setSidebarContent(Block sidebarContent) {
this._sidebarContent = sidebarContent;
}

@Parameter
private String _title;
public String getTitle() {
return _title;
}

public void setTitle(String title) {
this._title = title;
}
  cut some code here
}

in my Somepage.html
t:layout parameter=My Home 

i noticed the setter in Layout.java will not be called, why? thanks.

A.C.






or you can add the title parameter to Layout and pass it from Somepage

Layout.java:
@Parameter // if you want to require a title, add (required=true)
private String title; // add getter/setter

Somepage.html
t:layout title='my layout'
...




Josh Canfield-2 wrote:
 
 On 8/24/07, Angelo Chen [EMAIL PROTECTED] wrote:

 Hi Josh,

 This works, now if I have this in the Layout.html:

 head
title${title}/title
 /head

 Layout.java also has a getTtitle to return 'base page';

 now how to replace this title with 'somepage' in the somepage.html? I add
 a
 getTitle in the Somepage.java, but it still picks up 'base page', any
 solution to this?

 
 There is no inheritance relationship between Somepage and Layout.
 Somepage contains a reference to the Layout object. You have options
 with how you are going to update the layout.
 
 You can inject the Layout object into Somepage and manipulate it by:
 
 @Component
 private Layout layout; // add getter/setter
 protected void beforeRender() {
   layout.setTitle(title);
 }
 
 or you can add the title parameter to Layout and pass it from Somepage
 
 Layout.java:
 @Parameter // if you want to require a title, add (required=true)
 private String title; // add getter/setter
 
 Somepage.html
 t:layout title='my layout'
 ...
 /t:layout
 
 Pick the one that makes the most sense for your application
 
 
 
 A.C.
 Josh Canfield-2 wrote:
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
 
  Could it be as silly as a space after the xsd?
 
  I have run the following successfully
 
  -
 
 file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
  ---
 
  t:layout
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  t:parameter name=sidebarContent
  SomePage Added Sidebar
  /t:parameter
  This is the body content
  /t:layout
 
  -
  /src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
  ---
 
 
 

 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12309092
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12368634
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: T5:Tiles?

2007-08-28 Thread Josh Canfield
I think your problem is here:

 in my Somepage.html
 t:layout parameter=My Home 


You want

t:layout title=My Home

Josh

On 8/28/07, Angelo Chen [EMAIL PROTECTED] wrote:

 Hi Josh,

 I tried to folow following method, but not working:

 my Layout.java like this:

 public class Layout {

@Parameter
private Block _sidebarContent;

public Block getSidebarContent() {
return _sidebarContent;
}

public void setSidebarContent(Block sidebarContent) {
this._sidebarContent = sidebarContent;
}

@Parameter
private String _title;
public String getTitle() {
return _title;
}

public void setTitle(String title) {
this._title = title;
}
  cut some code here
 }

 in my Somepage.html
 t:layout parameter=My Home 

 i noticed the setter in Layout.java will not be called, why? thanks.

 A.C.






 or you can add the title parameter to Layout and pass it from Somepage

 Layout.java:
 @Parameter // if you want to require a title, add (required=true)
 private String title; // add getter/setter

 Somepage.html
 t:layout title='my layout'
 ...




 Josh Canfield-2 wrote:
 
  On 8/24/07, Angelo Chen [EMAIL PROTECTED] wrote:
 
  Hi Josh,
 
  This works, now if I have this in the Layout.html:
 
  head
 title${title}/title
  /head
 
  Layout.java also has a getTtitle to return 'base page';
 
  now how to replace this title with 'somepage' in the somepage.html? I add
  a
  getTitle in the Somepage.java, but it still picks up 'base page', any
  solution to this?
 
 
  There is no inheritance relationship between Somepage and Layout.
  Somepage contains a reference to the Layout object. You have options
  with how you are going to update the layout.
 
  You can inject the Layout object into Somepage and manipulate it by:
 
  @Component
  private Layout layout; // add getter/setter
  protected void beforeRender() {
layout.setTitle(title);
  }
 
  or you can add the title parameter to Layout and pass it from Somepage
 
  Layout.java:
  @Parameter // if you want to require a title, add (required=true)
  private String title; // add getter/setter
 
  Somepage.html
  t:layout title='my layout'
  ...
  /t:layout
 
  Pick the one that makes the most sense for your application
 
 
 
  A.C.
  Josh Canfield-2 wrote:
  
   html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
  
   Could it be as silly as a space after the xsd?
  
   I have run the following successfully
  
   -
  
  file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
   ---
  
   t:layout
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   t:parameter name=sidebarContent
   SomePage Added Sidebar
   /t:parameter
   This is the body content
   /t:layout
  
   -
   /src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
   ---
  
  
  
 
  --
  View this message in context:
  http://www.nabble.com/T5%3ATiles--tf4310807.html#a12309092
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos on the internet
  delivered fresh to your inbox.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12368634
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



Re: T5:Tiles?

2007-08-28 Thread Angelo Chen

Hi Josh,

I did like this:

t:layout title =myhome
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

but I got an error:

Class org.sample.t5.pages.Home does not contain a property named 'myhome'
(within property expression 'myhome').


Josh Canfield-2 wrote:
 
 I think your problem is here:
 
 in my Somepage.html
 t:layout parameter=My Home 

 
 You want
 
 t:layout title=My Home
 
 Josh
 
 On 8/28/07, Angelo Chen [EMAIL PROTECTED] wrote:

 Hi Josh,

 I tried to folow following method, but not working:

 my Layout.java like this:

 public class Layout {

@Parameter
private Block _sidebarContent;

public Block getSidebarContent() {
return _sidebarContent;
}

public void setSidebarContent(Block sidebarContent) {
this._sidebarContent = sidebarContent;
}

@Parameter
private String _title;
public String getTitle() {
return _title;
}

public void setTitle(String title) {
this._title = title;
}
  cut some code here
 }

 in my Somepage.html
 t:layout parameter=My Home 

 i noticed the setter in Layout.java will not be called, why? thanks.

 A.C.






 or you can add the title parameter to Layout and pass it from Somepage

 Layout.java:
 @Parameter // if you want to require a title, add (required=true)
 private String title; // add getter/setter

 Somepage.html
 t:layout title='my layout'
 ...




 Josh Canfield-2 wrote:
 
  On 8/24/07, Angelo Chen [EMAIL PROTECTED] wrote:
 
  Hi Josh,
 
  This works, now if I have this in the Layout.html:
 
  head
 title${title}/title
  /head
 
  Layout.java also has a getTtitle to return 'base page';
 
  now how to replace this title with 'somepage' in the somepage.html? I
 add
  a
  getTitle in the Somepage.java, but it still picks up 'base page', any
  solution to this?
 
 
  There is no inheritance relationship between Somepage and Layout.
  Somepage contains a reference to the Layout object. You have options
  with how you are going to update the layout.
 
  You can inject the Layout object into Somepage and manipulate it by:
 
  @Component
  private Layout layout; // add getter/setter
  protected void beforeRender() {
layout.setTitle(title);
  }
 
  or you can add the title parameter to Layout and pass it from Somepage
 
  Layout.java:
  @Parameter // if you want to require a title, add (required=true)
  private String title; // add getter/setter
 
  Somepage.html
  t:layout title='my layout'
  ...
  /t:layout
 
  Pick the one that makes the most sense for your application
 
 
 
  A.C.
  Josh Canfield-2 wrote:
  
   html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
 
  
   Could it be as silly as a space after the xsd?
  
   I have run the following successfully
  
   -
  
 
 file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
   ---
  
   t:layout
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   t:parameter name=sidebarContent
   SomePage Added Sidebar
   /t:parameter
   This is the body content
   /t:layout
  
   -
  
 /src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
   ---
  
  
  
 
  --
  View this message in context:
  http://www.nabble.com/T5%3ATiles--tf4310807.html#a12309092
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos on the internet
  delivered fresh to your inbox.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12368634
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12378608
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: T5:Tiles?

2007-08-28 Thread Thiago H. de Paula Figueiredo
Em Tue, 28 Aug 2007 20:52:28 -0300, Angelo Chen  
[EMAIL PROTECTED] escreveu:



Class org.sample.t5.pages.Home does not contain a property named 'myhome'
(within property expression 'myhome').



You want

t:layout title=My Home


Try t:layout title=literal:My Home

The literal: prefix guarantees that the value after it is treated as a  
String. The default prefix for all bindings is prop:, as the error above  
shows. :)


Thiago.

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



Re: T5:Tiles?

2007-08-28 Thread Angelo Chen

Hi Josh,

Your tip works, just an observation, when viewing the page in Mac's Safari,
for the url:

http://localhost/sample/forums

you will see in the address field first:
http://localhost/sample/layout.forums
then it goes back to http://localhost/sample/forums

but for Firefox or IE either in mac or windows, the layout.forums will not
be shown, only the final one.



Josh Canfield-2 wrote:
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
 
 Could it be as silly as a space after the xsd?
 
 I have run the following successfully
 
 -
 file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
 ---
 
 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 t:parameter name=sidebarContent
 SomePage Added Sidebar
 /t:parameter
 This is the body content
 /t:layout
 
 -
 /src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
 ---
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 head/
 body
 div id=headerThe Header/div
 div id=content-container
 t:body/
 /div
 div id=content-sidebar
 Top of Sidebar
 t:delegate to=sidebarContent/
 Bottom of Sidebar
 /div
 div id=footerThe Footer/div
 
 /body
 /html
 
 -- Layout.java ---
 
 package com.thedailytube.ui.tapestry.components;
 
 import org.apache.tapestry.Block;
 import org.apache.tapestry.annotations.Parameter;
 
 public class Layout {
 @Parameter
 private Block _sidebarContent;
 
 public Block getSidebarContent() {
 return _sidebarContent;
 }
 
 public void setSidebarContent(Block sidebarContent) {
 this._sidebarContent = sidebarContent;
 }
 }
 
 --- SomePage.java 
 
 package com.thedailytube.ui.tapestry.pages;
 
 public class SomePage {
 
 }
 
  http://localhost:8080/somepage -
 
 html
 headlink href=/assets/tapestry/default.css rel=stylesheet
 type=text/css/head
 body
 div id=headerThe Header/div
 div id=content-container
 
   
   This is the body content
 
 /div
 div id=content-sidebar
 Top of Sidebar
 
   SomePage Added Sidebar
   
 Bottom of Sidebar
 /div
 div id=footerThe Footer/div
 
 
 /body
 /html
 
 
 
 Josh
 
 On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 I added that but got another error:

 Component Somepage does not contain an embedded component with id 'html'.

 This is the Somepage.html:

 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

 t:parameter name=sidebarContent
 Add this additional to the sidebar
 /t:parameter
 All of this goes into the content section

 /t:layout



 Josh Canfield-2 wrote:
 
  Sorry, I should have had the Layout.java in there too... What that
 error
  is
  telling you is that it's looking for the 'sidebarContent' property in
 your
  Layout.java class. You can define it as below:
 
  public class Layout {
  @Parameter
  private Block _sidebarContent;
 
  public Block getSidebarContent() {
  return _sidebarContent;
  }
 
  public void setSidebarContent(Block sidebarContent) {
  this._sidebarContent = sidebarContent;
  }
  }
 
  Josh
 
  On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:
 
 
  Hi Josh,
 
  This looks interesting, I tried it with following steps:
 
  1.put Layout.html in the myapp/components, add also a Layout.java
  2. put Somepage.html under WEB-INTF, add Somepage.java in myapp/pages
 
  when I access it with http://localhost:8080/Somepage.html, I got
  following
  error:
 
  Could not convert 'sidebarContent' into a component parameter binding:
  Class
  org.example.myapp.components.Layout does not contain a property named
  'sidebarContent' (within property expression 'sidebarContent').
 
  What I did wrong here? Thanks,
 
  A.C.
 
 
  Josh Canfield-2 wrote:
  
   I love delegate for this type of stuff. If you want to define a
 layout
  and
   let the page decide what goes in the layout define a block parameter
  and
   use
   delegate to render it:
  
   (this has been truncated and modified for brevity, so while this may
  not
   work out of the box it's full size cousin does work...)
  
    somepage.html 
   t:layout xmlns:t=
 http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
  
   t:parameter name=sidebarContent
   Add this additional to the sidebar
   /t:parameter
   All of this goes into the content section
  
   /t:layout
  
  
   - layout.html 
  
   html
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   head.../head
   body
  
   div id=header.../div
   div id=content-container
   t:body/
   /div
   div id=content-sidebar
   !-- Let the page decide what goes in the sidebar --
   t:delegate to=sidebarContent/
   /div
   div id=footer.../div
  
   /body
   /html
  
   Enjoy,
   Josh
  
  --
  View this 

Re: T5:Tiles?

2007-08-28 Thread Josh Canfield

you will see in the address field first:
http://localhost/sample/layout.forums
then it goes back to http://localhost/sample/forums

but for Firefox or IE either in mac or windows, the layout.forums  
will not

be shown, only the final one.


I've tried it in Safari on my Mac and I've never seen that behavior.  
I don't believe that another request is generated simply by loading  
the page. Can you provide more information about what you are doing?  
Are your components and pages in the right folders?



TheDailyTube.com. The best new videos on the internet delivered fresh  
to your inbox.





Re: T5:Tiles?

2007-08-24 Thread Nick Westgate

The page location is http://localhost:8080/Somepage;

http://localhost:8080/Somepage.html; is the location of component html
on the page Somepage. I.e. Tapestry 5 uses . to specify components.
(Which might actually be a bad idea.)

Cheers,
Nick.


Angelo Chen wrote:

Hi Josh,

It works perfectly! thanks, It's my fault, I start the page directly:

http://localhost:8080/Somepage.html.

this works:

 t:PageLink t:page = Somepagesomepage/t:PageLink

don't know what's the difference.

A.C.


Josh Canfield-2 wrote:

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 

Could it be as silly as a space after the xsd?

I have run the following successfully






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



Re: T5:Tiles?

2007-08-24 Thread Angelo Chen

Hi Josh,

It works perfectly! thanks, It's my fault, I start the page directly:

http://localhost:8080/Somepage.html.

this works:

 t:PageLink t:page = Somepagesomepage/t:PageLink

don't know what's the difference.

A.C.


Josh Canfield-2 wrote:
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
 
 Could it be as silly as a space after the xsd?
 
 I have run the following successfully
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12307066
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: T5:Tiles?

2007-08-24 Thread Angelo Chen

Hi Josh,

What defined in the parameter block should be in the same
page(Somepage.html), can it refer to another html?

A.C.

 somepage.html 
t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:parameter name=sidebarContent
Add this additional to the sidebar
/t:parameter
All of this goes into the content section

/t:layout


Josh Canfield-2 wrote:
 
 I love delegate for this type of stuff. If you want to define a layout and
 let the page decide what goes in the layout define a block parameter and
 use
 delegate to render it:
 
 (this has been truncated and modified for brevity, so while this may not
 work out of the box it's full size cousin does work...)
 
  somepage.html 
 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 t:parameter name=sidebarContent
 Add this additional to the sidebar
 /t:parameter
 All of this goes into the content section
 
 /t:layout
 
 
 - layout.html 
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 head.../head
 body
 
 div id=header.../div
 div id=content-container
 t:body/
 /div
 div id=content-sidebar
 !-- Let the page decide what goes in the sidebar --
 t:delegate to=sidebarContent/
 /div
 div id=footer.../div
 
 /body
 /html
 
 Enjoy,
 Josh
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12307416
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: T5:Tiles?

2007-08-24 Thread Angelo Chen

Hi Josh,

This works, now if I have this in the Layout.html:

head
title${title}/title
/head

Layout.java also has a getTtitle to return 'base page';

now how to replace this title with 'somepage' in the somepage.html? I add a
getTitle in the Somepage.java, but it still picks up 'base page', any
solution to this?

A.C.



Josh Canfield-2 wrote:
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
 
 Could it be as silly as a space after the xsd?
 
 I have run the following successfully
 
 -
 file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
 ---
 
 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 t:parameter name=sidebarContent
 SomePage Added Sidebar
 /t:parameter
 This is the body content
 /t:layout
 
 -
 /src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
 ---
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12309092
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: T5:Tiles?

2007-08-24 Thread Josh Canfield
Hey Angelo,

Nick's right, sorry I didn't see that before.

Try using your browsers view source feature, if you're using Firefox look
into getting the firebug plugin (google for a tutorial) so you can inspect
what is actually getting rendered, you should never not know what is getting
generated in your page!

Josh


On 8/23/07, Nick Westgate [EMAIL PROTECTED] wrote:

 The page location is http://localhost:8080/Somepage;

 http://localhost:8080/Somepage.html; is the location of component html
 on the page Somepage. I.e. Tapestry 5 uses . to specify components.
 (Which might actually be a bad idea.)

 Cheers,
 Nick.


 Angelo Chen wrote:
  Hi Josh,
 
  It works perfectly! thanks, It's my fault, I start the page directly:
 
  http://localhost:8080/Somepage.html.
 
  this works:
 
   t:PageLink t:page = Somepagesomepage/t:PageLink
 
  don't know what's the difference.
 
  A.C.
 
 
  Josh Canfield-2 wrote:
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
 
  Could it be as silly as a space after the xsd?
 
  I have run the following successfully
 
 
 

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




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.


Re: T5:Tiles?

2007-08-24 Thread Josh Canfield
Yes, you can put other components inside of your block parameters.

On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 What defined in the parameter block should be in the same
 page(Somepage.html), can it refer to another html?

 A.C.

  somepage.html 
 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 t:parameter name=sidebarContent
 Add this additional to the sidebar
 /t:parameter
 All of this goes into the content section

 /t:layout


 Josh Canfield-2 wrote:
 
  I love delegate for this type of stuff. If you want to define a layout
 and
  let the page decide what goes in the layout define a block parameter and
  use
  delegate to render it:
 
  (this has been truncated and modified for brevity, so while this may not
  work out of the box it's full size cousin does work...)
 
   somepage.html 
  t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
 
  t:parameter name=sidebarContent
  Add this additional to the sidebar
  /t:parameter
  All of this goes into the content section
 
  /t:layout
 
 
  - layout.html 
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  head.../head
  body
 
  div id=header.../div
  div id=content-container
  t:body/
  /div
  div id=content-sidebar
  !-- Let the page decide what goes in the sidebar --
  t:delegate to=sidebarContent/
  /div
  div id=footer.../div
 
  /body
  /html
 
  Enjoy,
  Josh
 
 
 

 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12307416
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.


Re: T5:Tiles?

2007-08-24 Thread Josh Canfield
On 8/24/07, Angelo Chen [EMAIL PROTECTED] wrote:

 Hi Josh,

 This works, now if I have this in the Layout.html:

 head
title${title}/title
 /head

 Layout.java also has a getTtitle to return 'base page';

 now how to replace this title with 'somepage' in the somepage.html? I add a
 getTitle in the Somepage.java, but it still picks up 'base page', any
 solution to this?


There is no inheritance relationship between Somepage and Layout.
Somepage contains a reference to the Layout object. You have options
with how you are going to update the layout.

You can inject the Layout object into Somepage and manipulate it by:

@Component
private Layout layout; // add getter/setter
protected void beforeRender() {
  layout.setTitle(title);
}

or you can add the title parameter to Layout and pass it from Somepage

Layout.java:
@Parameter // if you want to require a title, add (required=true)
private String title; // add getter/setter

Somepage.html
t:layout title='my layout'
...
/t:layout

Pick the one that makes the most sense for your application



 A.C.
 Josh Canfield-2 wrote:
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 
 
  Could it be as silly as a space after the xsd?
 
  I have run the following successfully
 
  -
  file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
  ---
 
  t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  t:parameter name=sidebarContent
  SomePage Added Sidebar
  /t:parameter
  This is the body content
  /t:layout
 
  -
  /src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
  ---
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12309092
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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





-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



Re: T5:Tiles?

2007-08-23 Thread Angelo Chen

Hi Marcelo,

This works, thanks. Is this documented in T5 site? 

The difference between this(Border?) and Tiles is, in Tiles layout you can
specify multiple JSPs, T5's border can have only one, but you can have one
after the other. so the syntax is:

t:file name
/t:file name

right?





Marcelo lotif wrote:
 
 If this help, try to follow my example above:
 
 create a class under src/main/java/org/example/myapp/components called
 Layout.java, for example. Now we put a css stylesheet and a title, just to
 illustrate:
 
 public class Layout {
 
 @Inject
 @Path(context:assets/css/layout.css)
 private Asset layoutCSS;
 
 private String title = Some Title;
 
 public Asset getLayoutCSS() {
 return layoutCSS;
 }
 
 public String getTitle() {
 return title;
 }
 
 }
 
 now, create a template under
 src/main/resources/org/example/myapp/components
 with the same name (i.e. Layout.html):
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 head
 title{title}/title
 link href=${layoutCSS} rel=stylesheet type=text/css/
 /head
 body
 table width=100% height=100%  border=0
 tr
 td valign=top height=100%
 t:bodyPage content goes here./t:body
 /td
 /tr
 /table
 /body
 /html
 
 let the Start.html use this template as it's base adding this lines to it:
 
 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 !-- put the rest of the page here --
 /t:layout
 
 and you're done!
 very simple! :)
 
 2007/8/22, Anton Gavazuk [EMAIL PROTECTED]:

 Hi Angelo,
 I had the same question and as I understood - you have to write your own
 custom component
 see
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
 and now I try to implement this - if you are interested - we can
 communicate
 about the topic and create some kind of howto...

 2007/8/22, Angelo Chen [EMAIL PROTECTED] :
 
 
  Hi,
 
  Is there a way to do something like Struts with Tiles in Tapestry 5?
  samples? Thanks.
 
  A.C.
  --
  View this message in context:
  http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 
 
 
 -- 
 Atenciosamente,
 Marcelo Lotif
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12291330
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: T5:Tiles?

2007-08-23 Thread Marcelo lotif
You can have one layout wrapping another component, like a menu or a
sidebar. Of course they are declared into separeted .html's. Then, into the
Layout component you can 'call' the other components, like this call to an
existing Menu component into your workspace:

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
title {title}/title
link href=${layoutCSS} rel=stylesheet type=text/css/
/head
body
table width=100% height=100%  border=0
tr
td valign=top height=100%
 t:menu/ !-- this is the default for calling any
component --
/td
/tr
tr
td valign=top height=100%
t:bodyPage content goes here./t:body
/td
/tr
/table
/body
/html

and under src/main/resources/org/example/myapp/components you must declare
the Menu.html file just like this:

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  a t:type=PageLink page=fooFOO/a
/html

and the menu will be inserted on the location declared inside the Layout
component. I'm not sure if you have to create a Menu.java too, but i ever
do.

here you can also specify multiple templates, but the difference, at least
in this example, is that you have a 'main' wrapper that define the 'face' of
you app by a default call (t:body/) and explicit calls to specified
components.

Is that what you meant?

2007/8/23, Angelo Chen [EMAIL PROTECTED]:


 Hi Marcelo,

 This works, thanks. Is this documented in T5 site?

 The difference between this(Border?) and Tiles is, in Tiles layout you can
 specify multiple JSPs, T5's border can have only one, but you can have one
 after the other. so the syntax is:

 t:file name
 /t:file name

 right?





 Marcelo lotif wrote:
 
  If this help, try to follow my example above:
 
  create a class under src/main/java/org/example/myapp/components called
  Layout.java, for example. Now we put a css stylesheet and a title, just
 to
  illustrate:
 
  public class Layout {
 
  @Inject
  @Path(context:assets/css/layout.css)
  private Asset layoutCSS;
 
  private String title = Some Title;
 
  public Asset getLayoutCSS() {
  return layoutCSS;
  }
 
  public String getTitle() {
  return title;
  }
 
  }
 
  now, create a template under
  src/main/resources/org/example/myapp/components
  with the same name (i.e. Layout.html):
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  head
  title{title}/title
  link href=${layoutCSS} rel=stylesheet type=text/css/
  /head
  body
  table width=100% height=100%  border=0
  tr
  td valign=top height=100%
  t:bodyPage content goes here./t:body
  /td
  /tr
  /table
  /body
  /html
 
  let the Start.html use this template as it's base adding this lines to
 it:
 
  t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
 
  !-- put the rest of the page here --
  /t:layout
 
  and you're done!
  very simple! :)
 
  2007/8/22, Anton Gavazuk [EMAIL PROTECTED]:
 
  Hi Angelo,
  I had the same question and as I understood - you have to write your
 own
  custom component
  see
  http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
  and now I try to implement this - if you are interested - we can
  communicate
  about the topic and create some kind of howto...
 
  2007/8/22, Angelo Chen [EMAIL PROTECTED] :
  
  
   Hi,
  
   Is there a way to do something like Struts with Tiles in Tapestry 5?
   samples? Thanks.
  
   A.C.
   --
   View this message in context:
   http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065
   Sent from the Tapestry - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 
 
  --
  Atenciosamente,
  Marcelo Lotif
 
 

 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12291330
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
Atenciosamente,
Marcelo Lotif


Re: T5:Tiles?

2007-08-23 Thread Josh Canfield
I love delegate for this type of stuff. If you want to define a layout and
let the page decide what goes in the layout define a block parameter and use
delegate to render it:

(this has been truncated and modified for brevity, so while this may not
work out of the box it's full size cousin does work...)

 somepage.html 
t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:parameter name=sidebarContent
Add this additional to the sidebar
/t:parameter
All of this goes into the content section

/t:layout


- layout.html 

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head.../head
body

div id=header.../div
div id=content-container
t:body/
/div
div id=content-sidebar
!-- Let the page decide what goes in the sidebar --
t:delegate to=sidebarContent/
/div
div id=footer.../div

/body
/html

Enjoy,
Josh

On 8/23/07, Marcelo lotif [EMAIL PROTECTED] wrote:

 You can have one layout wrapping another component, like a menu or a
 sidebar. Of course they are declared into separeted .html's. Then, into
 the
 Layout component you can 'call' the other components, like this call to an
 existing Menu component into your workspace:

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
title {title}/title
link href=${layoutCSS} rel=stylesheet type=text/css/
/head
body
table width=100% height=100%  border=0
tr
td valign=top height=100%
 t:menu/ !-- this is the default for calling any
 component --
/td
/tr
tr
td valign=top height=100%
t:bodyPage content goes here./t:body
/td
/tr
/table
/body
 /html

 and under src/main/resources/org/example/myapp/components you must declare
 the Menu.html file just like this:

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  a t:type=PageLink page=fooFOO/a
 /html

 and the menu will be inserted on the location declared inside the Layout
 component. I'm not sure if you have to create a Menu.java too, but i ever
 do.

 here you can also specify multiple templates, but the difference, at least
 in this example, is that you have a 'main' wrapper that define the 'face'
 of
 you app by a default call (t:body/) and explicit calls to specified
 components.

 Is that what you meant?

 2007/8/23, Angelo Chen [EMAIL PROTECTED]:
 
 
  Hi Marcelo,
 
  This works, thanks. Is this documented in T5 site?
 
  The difference between this(Border?) and Tiles is, in Tiles layout you
 can
  specify multiple JSPs, T5's border can have only one, but you can have
 one
  after the other. so the syntax is:
 
  t:file name
  /t:file name
 
  right?
 
 
 
 
 
  Marcelo lotif wrote:
  
   If this help, try to follow my example above:
  
   create a class under src/main/java/org/example/myapp/components called
   Layout.java, for example. Now we put a css stylesheet and a title,
 just
  to
   illustrate:
  
   public class Layout {
  
   @Inject
   @Path(context:assets/css/layout.css)
   private Asset layoutCSS;
  
   private String title = Some Title;
  
   public Asset getLayoutCSS() {
   return layoutCSS;
   }
  
   public String getTitle() {
   return title;
   }
  
   }
  
   now, create a template under
   src/main/resources/org/example/myapp/components
   with the same name (i.e. Layout.html):
  
   html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   head
   title{title}/title
   link href=${layoutCSS} rel=stylesheet type=text/css/
   /head
   body
   table width=100% height=100%  border=0
   tr
   td valign=top height=100%
   t:bodyPage content goes here./t:body
   /td
   /tr
   /table
   /body
   /html
  
   let the Start.html use this template as it's base adding this lines to
  it:
  
   t:layout xmlns:t=
 http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
  
   !-- put the rest of the page here --
   /t:layout
  
   and you're done!
   very simple! :)
  
   2007/8/22, Anton Gavazuk [EMAIL PROTECTED]:
  
   Hi Angelo,
   I had the same question and as I understood - you have to write your
  own
   custom component
   see
  
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
   and now I try to implement this - if you are interested - we can
   communicate
   about the topic and create some kind of howto...
  
   2007/8/22, Angelo Chen [EMAIL PROTECTED] :
   
   
Hi,
   
Is there a way to do something like Struts with Tiles in Tapestry
 5?
samples? Thanks.
   
A.C.
--
View this message in context:
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065
Sent from the Tapestry - User mailing list archive at Nabble.com.
   
   
   
 

Re: T5:Tiles?

2007-08-23 Thread Jonathan Glanz
I personally use this exact process for builkding widget based pages.


Sent via BlackBerry by ATT

-Original Message-
From: Josh Canfield [EMAIL PROTECTED]

Date: Thu, 23 Aug 2007 11:16:55 
To:Tapestry users users@tapestry.apache.org
Subject: Re: T5:Tiles?


I love delegate for this type of stuff. If you want to define a layout and
let the page decide what goes in the layout define a block parameter and use
delegate to render it:

(this has been truncated and modified for brevity, so while this may not
work out of the box it's full size cousin does work...)

 somepage.html 
t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:parameter name=sidebarContent
Add this additional to the sidebar
/t:parameter
All of this goes into the content section

/t:layout


- layout.html 

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head.../head
body

div id=header.../div
div id=content-container
t:body/
/div
div id=content-sidebar
!-- Let the page decide what goes in the sidebar --
t:delegate to=sidebarContent/
/div
div id=footer.../div

/body
/html

Enjoy,
Josh

On 8/23/07, Marcelo lotif [EMAIL PROTECTED] wrote:

 You can have one layout wrapping another component, like a menu or a
 sidebar. Of course they are declared into separeted .html's. Then, into
 the
 Layout component you can 'call' the other components, like this call to an
 existing Menu component into your workspace:

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
title {title}/title
link href=${layoutCSS} rel=stylesheet type=text/css/
/head
body
table width=100% height=100%  border=0
tr
td valign=top height=100%
 t:menu/ !-- this is the default for calling any
 component --
/td
/tr
tr
td valign=top height=100%
t:bodyPage content goes here./t:body
/td
/tr
/table
/body
 /html

 and under src/main/resources/org/example/myapp/components you must declare
 the Menu.html file just like this:

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  a t:type=PageLink page=fooFOO/a
 /html

 and the menu will be inserted on the location declared inside the Layout
 component. I'm not sure if you have to create a Menu.java too, but i ever
 do.

 here you can also specify multiple templates, but the difference, at least
 in this example, is that you have a 'main' wrapper that define the 'face'
 of
 you app by a default call (t:body/) and explicit calls to specified
 components.

 Is that what you meant?

 2007/8/23, Angelo Chen [EMAIL PROTECTED]:
 
 
  Hi Marcelo,
 
  This works, thanks. Is this documented in T5 site?
 
  The difference between this(Border?) and Tiles is, in Tiles layout you
 can
  specify multiple JSPs, T5's border can have only one, but you can have
 one
  after the other. so the syntax is:
 
  t:file name
  /t:file name
 
  right?
 
 
 
 
 
  Marcelo lotif wrote:
  
   If this help, try to follow my example above:
  
   create a class under src/main/java/org/example/myapp/components called
   Layout.java, for example. Now we put a css stylesheet and a title,
 just
  to
   illustrate:
  
   public class Layout {
  
   @Inject
   @Path(context:assets/css/layout.css)
   private Asset layoutCSS;
  
   private String title = Some Title;
  
   public Asset getLayoutCSS() {
   return layoutCSS;
   }
  
   public String getTitle() {
   return title;
   }
  
   }
  
   now, create a template under
   src/main/resources/org/example/myapp/components
   with the same name (i.e. Layout.html):
  
   html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   head
   title{title}/title
   link href=${layoutCSS} rel=stylesheet type=text/css/
   /head
   body
   table width=100% height=100%  border=0
   tr
   td valign=top height=100%
   t:bodyPage content goes here./t:body
   /td
   /tr
   /table
   /body
   /html
  
   let the Start.html use this template as it's base adding this lines to
  it:
  
   t:layout xmlns:t=
 http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
  
   !-- put the rest of the page here --
   /t:layout
  
   and you're done!
   very simple! :)
  
   2007/8/22, Anton Gavazuk [EMAIL PROTECTED]:
  
   Hi Angelo,
   I had the same question and as I understood - you have to write your
  own
   custom component
   see
  
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
   and now I try to implement this - if you are interested - we can
   communicate
   about the topic and create some kind of howto...
  
   2007/8/22, Angelo Chen [EMAIL PROTECTED] :
   
   
Hi,
   
Is there a way to do something like Struts with Tiles in Tapestry
 5

Re: T5:Tiles?

2007-08-23 Thread Angelo Chen

Hi Josh,

This looks interesting, I tried it with following steps:

1.put Layout.html in the myapp/components, add also a Layout.java
2. put Somepage.html under WEB-INTF, add Somepage.java in myapp/pages

when I access it with http://localhost:8080/Somepage.html, I got following
error:

Could not convert 'sidebarContent' into a component parameter binding: Class
org.example.myapp.components.Layout does not contain a property named
'sidebarContent' (within property expression 'sidebarContent').

What I did wrong here? Thanks,

A.C.


Josh Canfield-2 wrote:
 
 I love delegate for this type of stuff. If you want to define a layout and
 let the page decide what goes in the layout define a block parameter and
 use
 delegate to render it:
 
 (this has been truncated and modified for brevity, so while this may not
 work out of the box it's full size cousin does work...)
 
  somepage.html 
 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 t:parameter name=sidebarContent
 Add this additional to the sidebar
 /t:parameter
 All of this goes into the content section
 
 /t:layout
 
 
 - layout.html 
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 head.../head
 body
 
 div id=header.../div
 div id=content-container
 t:body/
 /div
 div id=content-sidebar
 !-- Let the page decide what goes in the sidebar --
 t:delegate to=sidebarContent/
 /div
 div id=footer.../div
 
 /body
 /html
 
 Enjoy,
 Josh
 
-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12305428
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: T5:Tiles?

2007-08-23 Thread Josh Canfield
Sorry, I should have had the Layout.java in there too... What that error is
telling you is that it's looking for the 'sidebarContent' property in your
Layout.java class. You can define it as below:

public class Layout {
@Parameter
private Block _sidebarContent;

public Block getSidebarContent() {
return _sidebarContent;
}

public void setSidebarContent(Block sidebarContent) {
this._sidebarContent = sidebarContent;
}
}

Josh

On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 This looks interesting, I tried it with following steps:

 1.put Layout.html in the myapp/components, add also a Layout.java
 2. put Somepage.html under WEB-INTF, add Somepage.java in myapp/pages

 when I access it with http://localhost:8080/Somepage.html, I got following
 error:

 Could not convert 'sidebarContent' into a component parameter binding:
 Class
 org.example.myapp.components.Layout does not contain a property named
 'sidebarContent' (within property expression 'sidebarContent').

 What I did wrong here? Thanks,

 A.C.


 Josh Canfield-2 wrote:
 
  I love delegate for this type of stuff. If you want to define a layout
 and
  let the page decide what goes in the layout define a block parameter and
  use
  delegate to render it:
 
  (this has been truncated and modified for brevity, so while this may not
  work out of the box it's full size cousin does work...)
 
   somepage.html 
  t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
 
  t:parameter name=sidebarContent
  Add this additional to the sidebar
  /t:parameter
  All of this goes into the content section
 
  /t:layout
 
 
  - layout.html 
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  head.../head
  body
 
  div id=header.../div
  div id=content-container
  t:body/
  /div
  div id=content-sidebar
  !-- Let the page decide what goes in the sidebar --
  t:delegate to=sidebarContent/
  /div
  div id=footer.../div
 
  /body
  /html
 
  Enjoy,
  Josh
 
 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12305428
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.


Re: T5:Tiles?

2007-08-23 Thread Josh Canfield
html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd 

Could it be as silly as a space after the xsd?

I have run the following successfully

-
file:///C:/cygwin/workspace/svn/thedailytube/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html/src/main/resources/com/thedailytube/ui/tapestry/pages/SomePage.html
---

t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:parameter name=sidebarContent
bSomePage Added Sidebar/b
/t:parameter
This is the body content
/t:layout

-
/src/main/resources/com/thedailytube/ui/tapestry/components/Layout.html
---

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head/
body
div id=headerThe Header/div
div id=content-container
t:body/
/div
div id=content-sidebar
Top of Sidebar
t:delegate to=sidebarContent/
Bottom of Sidebar
/div
div id=footerThe Footer/div

/body
/html

-- Layout.java ---

package com.thedailytube.ui.tapestry.components;

import org.apache.tapestry.Block;
import org.apache.tapestry.annotations.Parameter;

public class Layout {
@Parameter
private Block _sidebarContent;

public Block getSidebarContent() {
return _sidebarContent;
}

public void setSidebarContent(Block sidebarContent) {
this._sidebarContent = sidebarContent;
}
}

--- SomePage.java 

package com.thedailytube.ui.tapestry.pages;

public class SomePage {

}

 http://localhost:8080/somepage -

html
headlink href=/assets/tapestry/default.css rel=stylesheet
type=text/css/head
body
div id=headerThe Header/div
div id=content-container


This is the body content

/div
div id=content-sidebar
Top of Sidebar

bSomePage Added Sidebar/b

Bottom of Sidebar
/div
div id=footerThe Footer/div


/body
/html



Josh

On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 I added that but got another error:

 Component Somepage does not contain an embedded component with id 'html'.

 This is the Somepage.html:

 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

 t:parameter name=sidebarContent
 Add this additional to the sidebar
 /t:parameter
 All of this goes into the content section

 /t:layout



 Josh Canfield-2 wrote:
 
  Sorry, I should have had the Layout.java in there too... What that error
  is
  telling you is that it's looking for the 'sidebarContent' property in
 your
  Layout.java class. You can define it as below:
 
  public class Layout {
  @Parameter
  private Block _sidebarContent;
 
  public Block getSidebarContent() {
  return _sidebarContent;
  }
 
  public void setSidebarContent(Block sidebarContent) {
  this._sidebarContent = sidebarContent;
  }
  }
 
  Josh
 
  On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:
 
 
  Hi Josh,
 
  This looks interesting, I tried it with following steps:
 
  1.put Layout.html in the myapp/components, add also a Layout.java
  2. put Somepage.html under WEB-INTF, add Somepage.java in myapp/pages
 
  when I access it with http://localhost:8080/Somepage.html, I got
  following
  error:
 
  Could not convert 'sidebarContent' into a component parameter binding:
  Class
  org.example.myapp.components.Layout does not contain a property named
  'sidebarContent' (within property expression 'sidebarContent').
 
  What I did wrong here? Thanks,
 
  A.C.
 
 
  Josh Canfield-2 wrote:
  
   I love delegate for this type of stuff. If you want to define a
 layout
  and
   let the page decide what goes in the layout define a block parameter
  and
   use
   delegate to render it:
  
   (this has been truncated and modified for brevity, so while this may
  not
   work out of the box it's full size cousin does work...)
  
    somepage.html 
   t:layout xmlns:t=
 http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
  
   t:parameter name=sidebarContent
   Add this additional to the sidebar
   /t:parameter
   All of this goes into the content section
  
   /t:layout
  
  
   - layout.html 
  
   html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   head.../head
   body
  
   div id=header.../div
   div id=content-container
   t:body/
   /div
   div id=content-sidebar
   !-- Let the page decide what goes in the sidebar --
   t:delegate to=sidebarContent/
   /div
   div id=footer.../div
  
   /body
   /html
  
   Enjoy,
   Josh
  
  --
  View this message in context:
  http://www.nabble.com/T5%3ATiles--tf4310807.html#a12305428
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos on the internet
  delivered fresh to your inbox.
 
 

 --
 View this message in context:
 

Re: T5:Tiles?

2007-08-23 Thread Angelo Chen

Hi Josh,

I added that but got another error:

Component Somepage does not contain an embedded component with id 'html'.

This is the Somepage.html:

t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

t:parameter name=sidebarContent
Add this additional to the sidebar
/t:parameter
All of this goes into the content section

/t:layout



Josh Canfield-2 wrote:
 
 Sorry, I should have had the Layout.java in there too... What that error
 is
 telling you is that it's looking for the 'sidebarContent' property in your
 Layout.java class. You can define it as below:
 
 public class Layout {
 @Parameter
 private Block _sidebarContent;
 
 public Block getSidebarContent() {
 return _sidebarContent;
 }
 
 public void setSidebarContent(Block sidebarContent) {
 this._sidebarContent = sidebarContent;
 }
 }
 
 Josh
 
 On 8/23/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi Josh,

 This looks interesting, I tried it with following steps:

 1.put Layout.html in the myapp/components, add also a Layout.java
 2. put Somepage.html under WEB-INTF, add Somepage.java in myapp/pages

 when I access it with http://localhost:8080/Somepage.html, I got
 following
 error:

 Could not convert 'sidebarContent' into a component parameter binding:
 Class
 org.example.myapp.components.Layout does not contain a property named
 'sidebarContent' (within property expression 'sidebarContent').

 What I did wrong here? Thanks,

 A.C.


 Josh Canfield-2 wrote:
 
  I love delegate for this type of stuff. If you want to define a layout
 and
  let the page decide what goes in the layout define a block parameter
 and
  use
  delegate to render it:
 
  (this has been truncated and modified for brevity, so while this may
 not
  work out of the box it's full size cousin does work...)
 
   somepage.html 
  t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
 
  t:parameter name=sidebarContent
  Add this additional to the sidebar
  /t:parameter
  All of this goes into the content section
 
  /t:layout
 
 
  - layout.html 
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  head.../head
  body
 
  div id=header.../div
  div id=content-container
  t:body/
  /div
  div id=content-sidebar
  !-- Let the page decide what goes in the sidebar --
  t:delegate to=sidebarContent/
  /div
  div id=footer.../div
 
  /body
  /html
 
  Enjoy,
  Josh
 
 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12305428
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3ATiles--tf4310807.html#a12306516
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: T5:Tiles?

2007-08-22 Thread Anton Gavazuk
Hi Angelo,
I had the same question and as I understood - you have to write your own
custom component
see http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
and now I try to implement this - if you are interested - we can communicate
about the topic and create some kind of howto...

2007/8/22, Angelo Chen [EMAIL PROTECTED] :


 Hi,

 Is there a way to do something like Struts with Tiles in Tapestry 5?
 samples? Thanks.

 A.C.
 --
 View this message in context:
 http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065
 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: T5:Tiles?

2007-08-22 Thread Marcelo lotif
If this help, try to follow my example above:

create a class under src/main/java/org/example/myapp/components called
Layout.java, for example. Now we put a css stylesheet and a title, just to
illustrate:

public class Layout {

@Inject
@Path(context:assets/css/layout.css)
private Asset layoutCSS;

private String title = Some Title;

public Asset getLayoutCSS() {
return layoutCSS;
}

public String getTitle() {
return title;
}

}

now, create a template under src/main/resources/org/example/myapp/components
with the same name (i.e. Layout.html):

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
title{title}/title
link href=${layoutCSS} rel=stylesheet type=text/css/
/head
body
table width=100% height=100%  border=0
tr
td valign=top height=100%
t:bodyPage content goes here./t:body
/td
/tr
/table
/body
/html

let the Start.html use this template as it's base adding this lines to it:

t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
!-- put the rest of the page here --
/t:layout

and you're done!
very simple! :)

2007/8/22, Anton Gavazuk [EMAIL PROTECTED]:

 Hi Angelo,
 I had the same question and as I understood - you have to write your own
 custom component
 see
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
 and now I try to implement this - if you are interested - we can
 communicate
 about the topic and create some kind of howto...

 2007/8/22, Angelo Chen [EMAIL PROTECTED] :
 
 
  Hi,
 
  Is there a way to do something like Struts with Tiles in Tapestry 5?
  samples? Thanks.
 
  A.C.
  --
  View this message in context:
  http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




-- 
Atenciosamente,
Marcelo Lotif


Re: T5:Tiles?

2007-08-22 Thread Daniel Jue
Of course you are not at all limited to only one of these layout
components.  While you can only request one per page or component, the
layout you request could itself use another layout.  For lack of a
better term, these used to be called Borders in Tapestry 4.

You can also have these borders on Components, not just pages.  This
can be useful for wrapping a component in a box, for example.  Borders
are really simple to make, as you've seen from Marcelo.

Now lets say you end up having lots of borders/layout components.  If
you want to put them into a directory under components/, you'll access
them using a . between the directory name and the border component
name.
i.e. for
components/layouts/border1.html
you would use:
t:layouts.border1
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

On 8/22/07, Marcelo lotif [EMAIL PROTECTED] wrote:
 If this help, try to follow my example above:

 create a class under src/main/java/org/example/myapp/components called
 Layout.java, for example. Now we put a css stylesheet and a title, just to
 illustrate:

 public class Layout {

 @Inject
 @Path(context:assets/css/layout.css)
 private Asset layoutCSS;

 private String title = Some Title;

 public Asset getLayoutCSS() {
 return layoutCSS;
 }

 public String getTitle() {
 return title;
 }

 }

 now, create a template under src/main/resources/org/example/myapp/components
 with the same name (i.e. Layout.html):

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 head
 title{title}/title
 link href=${layoutCSS} rel=stylesheet type=text/css/
 /head
 body
 table width=100% height=100%  border=0
 tr
 td valign=top height=100%
 t:bodyPage content goes here./t:body
 /td
 /tr
 /table
 /body
 /html

 let the Start.html use this template as it's base adding this lines to it:

 t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 !-- put the rest of the page here --
 /t:layout

 and you're done!
 very simple! :)

 2007/8/22, Anton Gavazuk [EMAIL PROTECTED]:
 
  Hi Angelo,
  I had the same question and as I understood - you have to write your own
  custom component
  see
  http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html
  and now I try to implement this - if you are interested - we can
  communicate
  about the topic and create some kind of howto...
 
  2007/8/22, Angelo Chen [EMAIL PROTECTED] :
  
  
   Hi,
  
   Is there a way to do something like Struts with Tiles in Tapestry 5?
   samples? Thanks.
  
   A.C.
   --
   View this message in context:
   http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065
   Sent from the Tapestry - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 



 --
 Atenciosamente,
 Marcelo Lotif


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