You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by TG <ta...@hotmail.com> on 2011/05/17 16:16:31 UTC

Hyperlink not becoming hyperlink

Hi,

This is a newbie question so please bear with me :) I used beanedit to
display HTML. So far I like it, but a column that contains hyperlink, the
values does not "become" a hyperlink that I can click to launch an external
site.

How do I make the values becoming a clickable hyperlink in Tapestry 5? Is
there any easy way? One line code is the best.

Thanks.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403607.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: Hyperlink not becoming hyperlink

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 17 May 2011 12:03:26 -0300, TG <ta...@hotmail.com> wrote:

> and it does not work. Any idea how to make the endpoint clickable URL
> automagically?

No. It's just a bit of HTML you need to write.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Hyperlink not becoming hyperlink

Posted by TG <ta...@hotmail.com>.
Yup, it works. Thanks so much for all responses!

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4404798.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: Hyperlink not becoming hyperlink

Posted by Robert Zeigler <ro...@roxanemy.com>.
change <p:url> to be: <p:urlCell>...</p:urlCell>

With BeanEditor, there is only one "thing" per attribute, so it's just the property name.  WIth grid, there is the header and the cell, so you have to add the Cell to the property name to override the cell rendering.

See: http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html for examples.

Robert

On May 17, 2011, at 5/1710:03 AM , TG wrote:

> Thanks for the prompt response. Actually I meant url as part of tapestry grid
> component. So I tried this -
> 
> <html t:type="layout"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
> xmlns:p="tapestry:parameter">
> ...
> <table t:type="grid" source="Urls" row="url" add="delete" rowsPerPage="15">
> ...
> 			<p:url>
>                		 ${url.endpoint} Link  
>        		</p:url> 
> ...
> 
> and it does not work. Any idea how to make the endpoint clickable URL
> automagically?
> 
> Thanks.
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403743.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: Hyperlink not becoming hyperlink

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 17 May 2011 12:22:16 -0300, TG <ta...@hotmail.com> wrote:

> Richard, I wish it is that simple :) No, it does not work.

It is that simple. ;) And saying it does not work without describing what  
happened is worse than saying nothing. ;) What's the generated HTML?  
Tapestry doesn't change any HTML element (besides <head>) which doesn't  
have a t:type attribute or begin with <t:, so a simple HTML <a> element  
should be enough.

By the way, I noticed you're using tapestry_5_0_0.xsd. It should be  
tapestry_5_1_0.xsd since Tapestry 5.1.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Hyperlink not becoming hyperlink

Posted by TG <ta...@hotmail.com>.
Richard, I wish it is that simple :) No, it does not work. Thanks anyway for
the tips.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403780.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: Hyperlink not becoming hyperlink

Posted by Richard Hill <ri...@su3analytics.com>.
<a href="${url}">link</a>  ?


On Tue, 2011-05-17 at 08:03 -0700, TG wrote:
> Thanks for the prompt response. Actually I meant url as part of tapestry grid
> component. So I tried this -
> 
> <html t:type="layout"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
> xmlns:p="tapestry:parameter">
> ...
> <table t:type="grid" source="Urls" row="url" add="delete" rowsPerPage="15">
> ...
>  			<p:url>
>                 		 ${url.endpoint} Link  
>         		</p:url> 
> ...
> 
> and it does not work. Any idea how to make the endpoint clickable URL
> automagically?
> 
> Thanks.
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403743.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: Hyperlink not becoming hyperlink

Posted by "Joost Schouten (ml)" <jo...@jsportal.com>.
  There is no logical relationship between the link and the Grid. I 
guess you want to display a link in one of your tabel cells right?

if so, you need to add this in your grid:

<table t:type="grid" source="Urls" row="url" add="delete" rowsPerPage="15">
  			<p:nameOfYourColumnPropertyCell>
				<a href="${url}">link</a>
			</p:nameOfYourColumnPropertyCell>
</table>

assuming that your component/page has a property getUrl() returning the url as a String.

by defining<p:nameOfYourColumnPropertyCell>...<p:nameOfYourColumnPropertyCell>  you overwrite the default markup that tapestry generates for your table cell. Readup on the documentation as all of this is covered there eg: http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html


Cheers,
Joost




On 17/05/11 5:03 PM, TG wrote:
> Thanks for the prompt response. Actually I meant url as part of tapestry grid
> component. So I tried this -
>
> <html t:type="layout"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
> xmlns:p="tapestry:parameter">
> ...
> <table t:type="grid" source="Urls" row="url" add="delete" rowsPerPage="15">
> ...
>   			<p:url>
>                  		${url.endpoint} Link
>          		</p:url>
> ...
>
> and it does not work. Any idea how to make the endpoint clickable URL
> automagically?
>
> Thanks.
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403743.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: Hyperlink not becoming hyperlink

Posted by TG <ta...@hotmail.com>.
Thanks for the prompt response. Actually I meant url as part of tapestry grid
component. So I tried this -

<html t:type="layout"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
xmlns:p="tapestry:parameter">
...
<table t:type="grid" source="Urls" row="url" add="delete" rowsPerPage="15">
...
 			<p:url>
                		 ${url.endpoint} Link  
        		</p:url> 
...

and it does not work. Any idea how to make the endpoint clickable URL
automagically?

Thanks.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403743.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: Hyperlink not becoming hyperlink

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 17 May 2011 11:16:31 -0300, TG <ta...@hotmail.com> wrote:

> Hi,

Hi!

> This is a newbie question so please bear with me :) I used beanedit to
> display HTML. So far I like it, but a column that contains hyperlink, the
> values does not "become" a hyperlink that I can click to launch an  
> external site.

Local solution: override the property rendering, supposing your URL  
property is named "url":

<div t:type="BeanEditForm" t:object="object">
	<p:url>
		<a href="${object.url}">Link</a>
	</p:url>
</div>

Global solution: implement a DataTypeAnalyzer and corresponding edition  
and viewing blocks. The BeanEditForm page in the documentation has one  
example.

> How do I make the values becoming a clickable hyperlink in Tapestry 5?

Just use an <a> element. Tapestry 5 isn't just BeanEditForm.

> Is there any easy way? One line code is the best.

BeanEditForm and BeanEditor are meant to be used to get something working  
quickly, not to be the end-all solution.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Hyperlink not becoming hyperlink

Posted by Rich M <ri...@moremagic.com>.
If I understand you correctly, you have some information stored in a 
field of your entity that is HTML mark-up for a hyperlink.

For example, a beanedit for the entity class Reference which has a field 
String website which for this entry has an html link like "<a 
href="somesite.com">Some Site</a>". If you want that to display as 
markup and not text, you would use the <t:outputraw 
t:value="entity.website" /> which will output it as HTML for you. You 
may need to override the column to insert this into the TML, the 
documentation for beanedit should make it clear how to do that if you 
don't know how.

On 05/17/2011 10:16 AM, TG wrote:
> Hi,
>
> This is a newbie question so please bear with me :) I used beanedit to
> display HTML. So far I like it, but a column that contains hyperlink, the
> values does not "become" a hyperlink that I can click to launch an external
> site.
>
> How do I make the values becoming a clickable hyperlink in Tapestry 5? Is
> there any easy way? One line code is the best.
>
> Thanks.
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403607.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