M3rlino
M3rlino

Reputation: 661

Jsf component for html tag

Does it exist a way to create a <a name="bookmark"> in jsf?

I would like to create a list with general bookmarks so that i can point them with links, i would like to create these links with values I take dynamically. h:outputLink doesn't have a name attribute.

Upvotes: 0

Views: 617

Answers (2)

Chris Dale
Chris Dale

Reputation: 2222

Using outputLink like this:

 <h:outputLink id="bookmark" /> 

generates the html:

<a id="bookmark" href="" name="bookmark"/>

So you could use the ID as your pointer?

Upvotes: 2

DigitalRoss
DigitalRoss

Reputation: 146053

Use Javascript or Output Filtering or a Custom Component

I think I would just use Javascript and patch up the anchors onload.

However, you could do output filtering. You could wrap the sub components inside your own and parse and modify the output. That does seem like a lot more work than just tweaking the document with JS.

If you are willing to create a custom component using facelets, a true but heavyweight solution, just go over here: How to add a new attribute to an existing JSF component.

Upvotes: 0

Related Questions