You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by dkeenan <da...@yahoo.co.uk> on 2012/08/20 15:39:54 UTC

Setting element value from an attribute

Hi. When creating dynamic content in a TML template file I normally do
something like this:

${user.email}


So when running the template in my tapestry app, I get a header with the
logged in user's email address.

But, when viewing the template outside of tapestry, as a normal file,
obviously I get "${user.email}" shown in the header.

I really like being able to design my templates outside of the application
and I would like to have something like this:

testuser@test.com
 

Is there a way of doing something like that so that my template looks okay
when viewed outside of the application, and the element is updated
appropriately when running inside the app?

Many thanks,

Dave.









--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-element-value-from-an-attribute-tp5715597.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting element value from an attribute

Posted by dkeenan <da...@yahoo.co.uk>.
brilliant! it actually works with outputraw, which means i don't have to
supply the format... and it's always going to be a string that I set, so
should be fine.

Thanks.




--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-element-value-from-an-attribute-tp5715597p5715609.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting element value from an attribute

Posted by Shing Hing Man <ma...@yahoo.com>.
I am making a meal of this. 


The existing  Output component  should do the job :

<t:output value="user.email">foo@yahoo.com</t:output>

Shing 

 



----- Original Message -----
From: dkeenan <da...@yahoo.co.uk>
To: users@tapestry.apache.org
Cc: 
Sent: Monday, August 20, 2012 3:25 PM
Subject: Re: Setting element value from an attribute

Could I extend that a little and create a component that does the following?

[hidden email]  

Then tapestry could replace the dispayed value with thee specified
'property'?

I wonder if a comonent like that exists, or how I would write one if it
doesn't?

Thanks...






--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-element-value-from-an-attribute-tp5715597p5715604.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

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


Re: Setting element value from an attribute

Posted by dkeenan <da...@yahoo.co.uk>.
Could I extend that a little and create a component that does the following?

 [hidden email]  

Then tapestry could replace the dispayed value with thee specified
'property'?

I wonder if a comonent like that exists, or how I would write one if it
doesn't?

Thanks...






--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-element-value-from-an-attribute-tp5715597p5715604.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting element value from an attribute

Posted by Shing Hing Man <ma...@yahoo.com>.
A not so elegant solution is to create a RemoveElt component so that the associated  html tag is not generated. 



 public class RemoveElt {
    
    protected boolean beginRender(){
        return false;
    }
    
}



Example : 

<span t:type="removeElt"> testuser@test.com </span>

The above <span> will not appear in the generated in html .

Shing





----- Original Message -----
From: dkeenan <da...@yahoo.co.uk>
To: users@tapestry.apache.org
Cc: 
Sent: Monday, August 20, 2012 2:39 PM
Subject: Setting element value from an attribute

Hi. When creating dynamic content in a TML template file I normally do
something like this:

${user.email}


So when running the template in my tapestry app, I get a header with the
logged in user's email address.

But, when viewing the template outside of tapestry, as a normal file,
obviously I get "${user.email}" shown in the header.

I really like being able to design my templates outside of the application
and I would like to have something like this:

testuser@test.com


Is there a way of doing something like that so that my template looks okay
when viewed outside of the application, and the element is updated
appropriately when running inside the app?

Many thanks,

Dave.









--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-element-value-from-an-attribute-tp5715597.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

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