You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kristian Marinkovic <kr...@porsche.co.at> on 2007/05/21 10:33:16 UTC

[T5] Question about invisible instrumentation with t:id

hi,

i created a stylesheet component that does not allow informal
parameters. i include my stylesheet component by using invisible
instrumentation with t:id like below:

<link t:id="stylesheet" href="style.css" />

Because T5 converts this to an Any component (see documentation)
it tries to evaluate "style.css" as a prop: binding and as there is no 
style object with a css property in my page i get an exception.

is there a way to prevent this behaviour so T5 does not try to evaluate
the (dummy text) parameters when using a component that does not allow 
informal parameters? 

Invisible instrumentation with t:id is my preferred way to declare 
components in my templates because it is the most friendly way for 
designer and developer as the designer cannot change any 
parameters :) and everything is configured in the page class 
using annotations. 

when i get such an exception automatic resource reloading for 
templates and classes does not work anymore.

g,
kris

Re: [T5] Question about invisible instrumentation with t:id

Posted by Howard Lewis Ship <hl...@gmail.com>.
On 5/21/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
>
> hi,
>
> i created a stylesheet component that does not allow informal
> parameters. i include my stylesheet component by using invisible
> instrumentation with t:id like below:
>
> <link t:id="stylesheet" href="style.css" />
>
> Because T5 converts this to an Any component (see documentation)
> it tries to evaluate "style.css" as a prop: binding and as there is no
> style object with a css property in my page i get an exception.



Please double check this; that is contrary to the code; informal parameters
are evaluated as literals by default.


is there a way to prevent this behaviour so T5 does not try to evaluate
> the (dummy text) parameters when using a component that does not allow
> informal parameters?
>
>
>

-- 
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: Antwort: Re: [T5] Question about invisible instrumentation with t:id

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Kristian Marinkovic wrote:
> ..... i think that was my problem i used the parameter name
> i defined in my template ("href") as a component parameter. when
> i rename my component parameter to lets say "paramhref" everything 
> works as expected.

Yes, the documentation for informal parameters mentions this:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html

The default binding issue generates plenty of debate in the dev list. ;-)

I've always been a fan of literal defaults in templates myself, but in T5
Howard has pared things down to avoid DRY e.g. listener="listener: ...

Cheers,
Nick.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Antwort: Re: [T5] Question about invisible instrumentation with t:id

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi massimo,

i already have:

public class Stylesheet {
    @Inject
    private AssetSource assetSource; 
 
    @Parameter
    private String href;


..... i think that was my problem i used the parameter name
i defined in my template ("href") as a component parameter. when
i rename my component parameter to lets say "paramhref" everything 
works as expected.

maybe there should be some checks..

thank you for your help
g,
kris






"Massimo Lusetti" <ml...@gmail.com> 
21.05.2007 12:15
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
"Tapestry users" <us...@tapestry.apache.org>
Kopie

Thema
Re: [T5] Question about invisible instrumentation with t:id






On 5/21/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:

> it does work with "literal:" but i'd like to avoid that designers
> know more about Tapestry than t:id :). especially when they
> want to preview the template with a real stylesheet without
> tapestry.

Specify it in the class file as component parameter.

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org



Re: [T5] Question about invisible instrumentation with t:id

Posted by Massimo Lusetti <ml...@gmail.com>.
On 5/21/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:

> it does work with "literal:" but i'd like to avoid that designers
> know more about Tapestry than t:id :). especially when they
> want to preview the template with a real stylesheet without
> tapestry.

Specify it in the class file as component parameter.

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Question about invisible instrumentation with t:id

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi massimo,

it does work with "literal:" but i'd like to avoid that designers
know more about Tapestry than t:id :). especially when they
want to preview the template with a real stylesheet without 
tapestry.

I've not looked deep enough into T5 template parsing but
i expected it will ignore every parameter if it recognizes it
is a component that is defined using t:id and assume there
are just informal parameters or discard them if the component
does not support them 

.... or maybe evaluate the parameters
only if the parameters are not set within the @Component 
annotation :) ... (just a thought)

g,
kris




"Massimo Lusetti" <ml...@gmail.com> 
21.05.2007 10:37
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
"Tapestry users" <us...@tapestry.apache.org>
Kopie

Thema
Re: [T5] Question about invisible instrumentation with t:id






On 5/21/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:

> is there a way to prevent this behaviour so T5 does not try to evaluate
> the (dummy text) parameters when using a component that does not allow
> informal parameters?

Did you try literal prefix?

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org



Re: [T5] Question about invisible instrumentation with t:id

Posted by Massimo Lusetti <ml...@gmail.com>.
On 5/21/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:

> is there a way to prevent this behaviour so T5 does not try to evaluate
> the (dummy text) parameters when using a component that does not allow
> informal parameters?

Did you try literal prefix?

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org