JSF prependId

If you are working with JavaScript it is useful to target elements by their ids. If you have used JSF, you may have run into generated id's causing difficulites with have noticed that form elements will prepend the form ID to

prependId="true" all ids are passed 1:1 without any transformation

If you are

example what it looks like

JSF 2.2

Yep, prependId has been in JSF since 1.0!


This generates

JSF 2.2

Same goes with JSF 2.2 and passthrough objects

For example, lets take a JSF 2.2 template using passthrough objects. Prepend ID