You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Erik Hatcher <er...@ehatchersolutions.com> on 2004/04/06 22:34:05 UTC
Re: How to add title to border?
On Apr 6, 2004, at 5:17 PM, Obivatelj@oralna-zadovoljstva.com wrote:
> I am playing with Tapestry for couple of days and I don't know how to
> set title in page when I am using "border" component. What to put in
> expression in Frame.jwc to display static title text from Main.page?
> Here is source:
>
> Frame.jwc:
> ~~~~~~~
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE component-specification
> PUBLIC "-//Apache Software Foundation//Tapestry Specification
> 3.0//EN"
> "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
>
> <component-specification class="org.apache.tapestry.BaseComponent"
> allow-informal-parameters="no">
> <parameter name="title" type="java.lang.String" required="yes" />
>
> <component id="shell" type="Shell">
> <binding name="title" expression="????" />
> </component>
>
> </component-specification>
Simply expression="title" :)
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to add title to border?
Posted by Ob...@oralna-zadovoljstva.com.
> > On Apr 6, 2004, at 5:17 PM, Obivatelj@oralna-zadovoljstva.com wrote:
> Now is title just empty string, it does not show any text. I change in Frame.jwc:
>
> <component-specification class="hr.gracilis.ks.base.FrameComponent" allow-informal-parameters="no">
> .....
> <binding name="title" expression="title" />
>
> In Main.page is still:
>
> <static-binding name="title">Glavna stranica</static-binding>
Now I get <title>StaticBinding[Glavna stranica]</title> which is nice, the question is how to remove StaticBinding text?
In Frame.jwc return to:
<component-specification class="org.apache.tapestry.BaseComponent" allow-informal-parameters="no">
.....
<binding name="title" expression="bindings.title" />
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to add title to border?
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 7, 2004, at 8:46 AM, Obivatelj@oralna-zadovoljstva.com wrote:
>> Get rid of the getter/setter and storage of title in FrameComponent -
>> the <parameter> takes care of that for you, and may be the problem.
>>
>> Also, Tapestry's examples use a Border component that does what you
>> are
>> after here, so refer to that for examples.
>
> I found it, syntax is:
>
> <binding name="title" expression="bindings.title.string" />
This is way overkill.
Here's a simple example. Notice no .java *at all*.
Border.jwc
<component-specification>
<parameter name="title"
required="no"
type="java.lang.String"
direction="in"
/>
<context-asset name="stylesheet" path="css/styles.css"/>
</component-specification>
Border.html
<html jwcid="@Shell" title="ognl:title">
<body jwcid="@Body">
<h1><span jwcid="@Insert" value="ognl:title"/></h1>
Header
<div jwcid="@RenderBody"/>
Footer
</body>
</html>
Home.html
<body jwcid="@Border" title="The Home Page">
HOME SWEET HOME
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to add title to border?
Posted by Ob...@oralna-zadovoljstva.com.
> Get rid of the getter/setter and storage of title in FrameComponent -
> the <parameter> takes care of that for you, and may be the problem.
>
> Also, Tapestry's examples use a Border component that does what you are
> after here, so refer to that for examples.
I found it, syntax is:
<binding name="title" expression="bindings.title.string" />
I started with border example and now is modified to work in way I want to, thanks for help.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to add title to border?
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Get rid of the getter/setter and storage of title in FrameComponent -
the <parameter> takes care of that for you, and may be the problem.
Also, Tapestry's examples use a Border component that does what you are
after here, so refer to that for examples.
Erik
On Apr 7, 2004, at 4:16 AM, Obivatelj@oralna-zadovoljstva.com wrote:
>> On Apr 6, 2004, at 5:17 PM, Obivatelj@oralna-zadovoljstva.com wrote:
>>> <component-specification class="org.apache.tapestry.BaseComponent"
>>> allow-informal-parameters="no">
>>> <parameter name="title" type="java.lang.String" required="yes" />
>>>
>>> <component id="shell" type="Shell">
>>> <binding name="title" expression="????" />
>>> </component>
>>>
>>> </component-specification>
>>
>> Simply expression="title" :)
>
> Now is title just empty string, it does not show any text. I change in
> Frame.jwc:
>
> <component-specification class="hr.gracilis.ks.base.FrameComponent"
> allow-informal-parameters="no">
> .....
> <binding name="title" expression="title" />
>
> In FrameComponent.java:
>
> package hr.gracilis.ks.base;
>
> import org.apache.tapestry.BaseComponent;
>
> public class FrameComponent extends BaseComponent {
> private String title=null;
>
> public String getTitle() {
> return title;
> }
>
> public void setTitle(String title) {
> this.title = title;
> }
> }
>
> In Main.page is still:
>
> <static-binding name="title">Glavna stranica</static-binding>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to add title to border?
Posted by Ob...@oralna-zadovoljstva.com.
> On Apr 6, 2004, at 5:17 PM, Obivatelj@oralna-zadovoljstva.com wrote:
> > <component-specification class="org.apache.tapestry.BaseComponent"
> > allow-informal-parameters="no">
> > <parameter name="title" type="java.lang.String" required="yes" />
> >
> > <component id="shell" type="Shell">
> > <binding name="title" expression="????" />
> > </component>
> >
> > </component-specification>
>
> Simply expression="title" :)
Now is title just empty string, it does not show any text. I change in Frame.jwc:
<component-specification class="hr.gracilis.ks.base.FrameComponent" allow-informal-parameters="no">
.....
<binding name="title" expression="title" />
In FrameComponent.java:
package hr.gracilis.ks.base;
import org.apache.tapestry.BaseComponent;
public class FrameComponent extends BaseComponent {
private String title=null;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
In Main.page is still:
<static-binding name="title">Glavna stranica</static-binding>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org