• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my jsp i have some text which is being displayed with the help of <hutputtext> 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.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks a lot Tim.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!