build component - HTML template

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

build component - HTML template

Eric Tan
Dear all,

   Is there any tutorial teaching how to build
reusable component?

   I want to build a HTML template, used by all page
of my  webapp.

  It should be able to change:
  - header
  - left menu
  - footer

  It should be able to load "username" & other session
variable.

   Thank you very much.

Best regards,
   Eric Tan



__________________________________
?Q?Y?????s email ?q???H
?U?? Yahoo! Messenger
http://messenger.yahoo.com.hk/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Pablo Ruggia
You have to read Tapestry In Action. It has a complete chapter on
Reusable Components and have some chapters on making a real
application (a Library) on Tapestry.

On 5/25/05, Eric Tan <[hidden email]> wrote:

> Dear all,
>
>    Is there any tutorial teaching how to build
> reusable component?
>
>    I want to build a HTML template, used by all page
> of my  webapp.
>
>   It should be able to change:
>   - header
>   - left menu
>   - footer
>
>   It should be able to load "username" & other session
> variable.
>
>    Thank you very much.
>
> Best regards,
>    Eric Tan
>
>
>
> __________________________________
> 想即時收到新 email 通知?
> 下載 Yahoo! Messenger
> http://messenger.yahoo.com.hk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Jamie Orchard-Hays
In reply to this post by Eric Tan
Use Border for this. Have a look at some of the examples or in the docs.

Jamie
On May 25, 2005, at 5:16 AM, Eric Tan wrote:

> Dear all,
>
>    Is there any tutorial teaching how to build
> reusable component?
>
>    I want to build a HTML template, used by all page
> of my  webapp.
>
>   It should be able to change:
>   - header
>   - left menu
>   - footer
>
>   It should be able to load "username" & other session
> variable.
>
>    Thank you very much.
>
> Best regards,
>    Eric Tan
>
>
>
> __________________________________
> 想即時收到新 email 通知?
> 下載 Yahoo! Messenger
> http://messenger.yahoo.com.hk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Eric Tan
In reply to this post by Eric Tan
Dear all,

   Component [Frame.jwc] has to load the left menu
[Left.page], which is also a tapestry page. Should I
load inside the Frame.java or use something like
"RenderBody" ?

   Would you please give me some hints?

   Thank you very much.

Best regards,
    Eric Tan

--- Eric Tan <[hidden email]> ???g:

> Dear all,
>
>    Is there any tutorial teaching how to build
> reusable component?
>
>    I want to build a HTML template, used by all page
> of my  webapp.
>
>   It should be able to change:
>   - header
>   - left menu
>   - footer
>
>   It should be able to load "username" & other
> session
> variable.
>
>    Thank you very much.
>
> Best regards,
>    Eric Tan
>
>
>
> __________________________________
> ?Q?Y?????s email ?q???H
> ?U?? Yahoo! Messenger
> http://messenger.yahoo.com.hk/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

__________________________________
?Q?Y?????s email ?q???H
?U?? Yahoo! Messenger
http://messenger.yahoo.com.hk/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Eric Tan
In reply to this post by Eric Tan
Frame.jwc should also display some session information
such as "LoginName". But I cannot "getVisit()"?

What should I do? Thank you very much.

--- Eric Tan <[hidden email]> ???g:

> Dear all,
>
>    Component [Frame.jwc] has to load the left menu
> [Left.page], which is also a tapestry page. Should I
> load inside the Frame.java or use something like
> "RenderBody" ?
>
>    Would you please give me some hints?
>
>    Thank you very much.
>
> Best regards,
>     Eric Tan
>
> --- Eric Tan <[hidden email]> ???g:
> > Dear all,
> >
> >    Is there any tutorial teaching how to build
> > reusable component?
> >
> >    I want to build a HTML template, used by all
> page
> > of my  webapp.
> >
> >   It should be able to change:
> >   - header
> >   - left menu
> >   - footer
> >
> >   It should be able to load "username" & other
> > session
> > variable.
> >
> >    Thank you very much.
> >
> > Best regards,
> >    Eric Tan
> >
> >
> >
> > __________________________________
> > ?Q?Y?????s email ?q???H
> > ?U?? Yahoo! Messenger
> > http://messenger.yahoo.com.hk/
> >
> >
>
---------------------------------------------------------------------

> > To unsubscribe, e-mail:
> > [hidden email]
> > For additional commands, e-mail:
> > [hidden email]
> >
> >
>
> __________________________________
> ?Q?Y?????s email ?q???H
> ?U?? Yahoo! Messenger
> http://messenger.yahoo.com.hk/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

__________________________________
?Q?Y?????s email ?q???H
?U?? Yahoo! Messenger
http://messenger.yahoo.com.hk/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Andreas Andreou-4
Can't you turn your Left menu into a component?
You can then use something like
<span jwcid="@Left"/> to include it in other components or
pages.
Also, in a component you can do
ognl:page.visit to access the visit object

Eric Tan wrote:

>Frame.jwc should also display some session information
>such as "LoginName". But I cannot "getVisit()"?
>
>What should I do? Thank you very much.
>
>--- Eric Tan <[hidden email]> ???g:
>  
>
>>Dear all,
>>
>>   Component [Frame.jwc] has to load the left menu
>>[Left.page], which is also a tapestry page. Should I
>>load inside the Frame.java or use something like
>>"RenderBody" ?
>>
>>   Would you please give me some hints?
>>
>>   Thank you very much.
>>
>>Best regards,
>>    Eric Tan
>>
>>--- Eric Tan <[hidden email]> ???g:
>>    
>>
>>>Dear all,
>>>
>>>   Is there any tutorial teaching how to build
>>>reusable component?
>>>
>>>   I want to build a HTML template, used by all
>>>      
>>>
>>page
>>    
>>
>>>of my  webapp.
>>>
>>>  It should be able to change:
>>>  - header
>>>  - left menu
>>>  - footer
>>>
>>>  It should be able to load "username" & other
>>>session
>>>variable.
>>>
>>>   Thank you very much.
>>>
>>>Best regards,
>>>   Eric Tan
>>>
>>>
>>>
>>>__________________________________
>>>?Q?Y?????s email ?q???H
>>>?U?? Yahoo! Messenger
>>>http://messenger.yahoo.com.hk/
>>>
>>>
>>>      
>>>
>---------------------------------------------------------------------
>  
>
>>>To unsubscribe, e-mail:
>>>[hidden email]
>>>For additional commands, e-mail:
>>>[hidden email]
>>>
>>>
>>>      
>>>
>>__________________________________
>>?Q?Y?????s email ?q???H
>>?U?? Yahoo! Messenger
>>http://messenger.yahoo.com.hk/
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>[hidden email]
>>For additional commands, e-mail:
>>[hidden email]
>>
>>
>>    
>>
>
>__________________________________
>?Q?Y?????s email ?q???H
>?U?? Yahoo! Messenger
>http://messenger.yahoo.com.hk/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Eric Tan
In reply to this post by Eric Tan
Thank you Andreas Andreou!

You solve my session problem.
But how about the left menu, how to implement "@Left"
component? So that other page can load dynamically
such as "userMenu.html", "productMenu.html"

may be the result is like this

<html jwcid="$content$">
<body jwcid="@Frame" left="userMenu">
    User content
</body>
</html>


<html jwcid="$content$">
<body jwcid="@Frame" left="productMenu">
    Product content
</body>
</html>

Thanks & regards,
   Eric Tan

--- Andreas Andreou <[hidden email]> ???g:

> Can't you turn your Left menu into a component?
> You can then use something like
> <span jwcid="@Left"/> to include it in other
> components or
> pages.
> Also, in a component you can do
> ognl:page.visit to access the visit object
>
> Eric Tan wrote:
>
> >Frame.jwc should also display some session
> information
> >such as "LoginName". But I cannot "getVisit()"?
> >
> >What should I do? Thank you very much.
> >
> >--- Eric Tan <[hidden email]> ???g:
> >  
> >
> >>Dear all,
> >>
> >>   Component [Frame.jwc] has to load the left menu
> >>[Left.page], which is also a tapestry page. Should
> I
> >>load inside the Frame.java or use something like
> >>"RenderBody" ?
> >>
> >>   Would you please give me some hints?
> >>
> >>   Thank you very much.
> >>
> >>Best regards,
> >>    Eric Tan
> >>
> >>--- Eric Tan <[hidden email]> ???g:
> >>    
> >>
> >>>Dear all,
> >>>
> >>>   Is there any tutorial teaching how to build
> >>>reusable component?
> >>>
> >>>   I want to build a HTML template, used by all
> >>>      
> >>>
> >>page
> >>    
> >>
> >>>of my  webapp.
> >>>
> >>>  It should be able to change:
> >>>  - header
> >>>  - left menu
> >>>  - footer
> >>>
> >>>  It should be able to load "username" & other
> >>>session
> >>>variable.
> >>>
> >>>   Thank you very much.
> >>>
> >>>Best regards,
> >>>   Eric Tan
> >>>
> >>>
> >>>
> >>>__________________________________
> >>>?Q?Y?????s email ?q???H
> >>>?U?? Yahoo! Messenger
> >>>http://messenger.yahoo.com.hk/
> >>>
> >>>
> >>>      
> >>>
>
>---------------------------------------------------------------------
> >  
> >
> >>>To unsubscribe, e-mail:
> >>>[hidden email]
> >>>For additional commands, e-mail:
> >>>[hidden email]
> >>>
> >>>
> >>>      
> >>>
> >>__________________________________
> >>?Q?Y?????s email ?q???H
> >>?U?? Yahoo! Messenger
> >>http://messenger.yahoo.com.hk/
> >>
> >>
> >>    
> >>
>
>---------------------------------------------------------------------
> >  
> >
> >>To unsubscribe, e-mail:
> >>[hidden email]
> >>For additional commands, e-mail:
> >>[hidden email]
> >>
> >>
> >>    
> >>
> >
> >__________________________________
> >?Q?Y?????s email ?q???H
> >?U?? Yahoo! Messenger
> >http://messenger.yahoo.com.hk/
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> [hidden email]
> >For additional commands, e-mail:
> [hidden email]
> >
> >
> >  
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

__________________________________
?Q?Y?????s email ?q???H
?U?? Yahoo! Messenger
http://messenger.yahoo.com.hk/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Andreas Andreou-4
First, take a look at RenderBlock. It's also useful in many cases.
http://jakarta.apache.org/tapestry/doc/ComponentReference/RenderBlock.html

However, for the specific problem you're describing (as I understand
it), you should use Delegator
http://jakarta.apache.org/tapestry/doc/ComponentReference/Delegator.html
In your Frame.jwc, define a parameter of type
org.apache.tapestry.IRender (all components implement this)
and in you Frame.html do something like:
<span jwcid="@Delegator" delegate="ognl:myIRenderParameter"/>

Eric Tan wrote:

>Thank you Andreas Andreou!
>
>You solve my session problem.
>But how about the left menu, how to implement "@Left"
>component? So that other page can load dynamically
>such as "userMenu.html", "productMenu.html"
>
>may be the result is like this
>
><html jwcid="$content$">
><body jwcid="@Frame" left="userMenu">
>    User content
></body>
></html>
>
>
><html jwcid="$content$">
><body jwcid="@Frame" left="productMenu">
>    Product content
></body>
></html>
>
>Thanks & regards,
>   Eric Tan
>
>--- Andreas Andreou <[hidden email]> ???g:
>  
>
>>Can't you turn your Left menu into a component?
>>You can then use something like
>><span jwcid="@Left"/> to include it in other
>>components or
>>pages.
>>Also, in a component you can do
>>ognl:page.visit to access the visit object
>>
>>Eric Tan wrote:
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Alberto Lepe
To call the visit object within your component:

getPage().getVisit();

Please visit: www.tapestryforums.com and Join us!

2005/5/27, Andreas Andreou <[hidden email]>:

> First, take a look at RenderBlock. It's also useful in many cases.
> http://jakarta.apache.org/tapestry/doc/ComponentReference/RenderBlock.html
>
> However, for the specific problem you're describing (as I understand
> it), you should use Delegator
> http://jakarta.apache.org/tapestry/doc/ComponentReference/Delegator.html
> In your Frame.jwc, define a parameter of type
> org.apache.tapestry.IRender (all components implement this)
> and in you Frame.html do something like:
> <span jwcid="@Delegator" delegate="ognl:myIRenderParameter"/>
>
> Eric Tan wrote:
>
> >Thank you Andreas Andreou!
> >
> >You solve my session problem.
> >But how about the left menu, how to implement "@Left"
> >component? So that other page can load dynamically
> >such as "userMenu.html", "productMenu.html"
> >
> >may be the result is like this
> >
> ><html jwcid="$content$">
> ><body jwcid="@Frame" left="userMenu">
> >    User content
> ></body>
> ></html>
> >
> >
> ><html jwcid="$content$">
> ><body jwcid="@Frame" left="productMenu">
> >    Product content
> ></body>
> ></html>
> >
> >Thanks & regards,
> >   Eric Tan
> >
> >--- Andreas Andreou <[hidden email]> ΌΆΌg:
> >
> >
> >>Can't you turn your Left menu into a component?
> >>You can then use something like
> >><span jwcid="@Left"/> to include it in other
> >>components or
> >>pages.
> >>Also, in a component you can do
> >>ognl:page.visit to access the visit object
> >>
> >>Eric Tan wrote:
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: build component - HTML template

Eric Tan
In reply to this post by Eric Tan
Is there any tutorial or reference which can show me
how to use the Delegator component?

Can some body suggest how to learn such the tapestry
build-in component? I find it difficult to understand
and always have to guess how to use them?!

Thanks and regards
   Eric Tan

--- Andreas Andreou <[hidden email]> ???g:
> First, take a look at RenderBlock. It's also useful
> in many cases.
>
http://jakarta.apache.org/tapestry/doc/ComponentReference/RenderBlock.html
>
> However, for the specific problem you're describing
> (as I understand
> it), you should use Delegator
>
http://jakarta.apache.org/tapestry/doc/ComponentReference/Delegator.html

> In your Frame.jwc, define a parameter of type
> org.apache.tapestry.IRender (all components
> implement this)
> and in you Frame.html do something like:
> <span jwcid="@Delegator"
> delegate="ognl:myIRenderParameter"/>
>
> Eric Tan wrote:
>
> >Thank you Andreas Andreou!
> >
> >You solve my session problem.
> >But how about the left menu, how to implement
> "@Left"
> >component? So that other page can load dynamically
> >such as "userMenu.html", "productMenu.html"
> >
> >may be the result is like this
> >
> ><html jwcid="$content$">
> ><body jwcid="@Frame" left="userMenu">
> >    User content
> ></body>
> ></html>
> >
> >
> ><html jwcid="$content$">
> ><body jwcid="@Frame" left="productMenu">
> >    Product content
> ></body>
> ></html>
> >
> >Thanks & regards,
> >   Eric Tan
> >
> >--- Andreas Andreou <[hidden email]> ???g:
> >  
> >
> >>Can't you turn your Left menu into a component?
> >>You can then use something like
> >><span jwcid="@Left"/> to include it in other
> >>components or
> >>pages.
> >>Also, in a component you can do
> >>ognl:page.visit to access the visit object
> >>
> >>Eric Tan wrote:
> >>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

__________________________________
?Q?Y?????s email ?q???H
?U?? Yahoo! Messenger
http://messenger.yahoo.com.hk/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]