• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to write a h:commandLink tag inside h:outputText tag

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In my jsp i have some text which is being displayed with the help of <h:outputtext> tag. i need to have a hyper link inside this value.

I am not finding any way how can i write tag inside .

My command link is as follows:

<h:commandLink action="#{controller.download}" value="here1"/>

If anyone has any idea please share.

Thanks in advance.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't work that way.

You have to put the outputText inside the commandLink element.

If you're looking for text where only part of the text is a hyperlink, use the following structure:

outputText (non-link text)
commandLink
- outputText (link text)
outputText (non-link text)

If the text is in a panelGrid, you can use the panelGroup element as their parent so that the 3 components don't end up in different cells.
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Tim,

thanks for your reply.

I am trying like :

outputText (non-link text)
commandLink
- outputText (link text)

but they are coming in different cells.
Could you please tell me more about "panelGroup element as parent" so that they come in same line/cell.

Thanks.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just wrap an "h:panelGroup" element around the outputText/commandLink elements:

panelGrid
- panelGroup
- - outputText
- - commmmandLink
- - - outputText
- - outputText
- (next grid cell element)
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Tim.
 
reply
    Bookmark Topic Watch Topic
  • New Topic