2
1
|
I know what
prependId=false does. It set the flag so that the id of the form does not prepend the id of the form child, but why? any particular reason why you do or dont want to prepend id?
| ||
feedback
|
8
|
In my experience, I never use this attribute. However, in some cases it can be useful.
When you use Facelets, you can create templates or include pages inside another page. So you can imagine that a page could be included in several different pages. Take the example where the parent pages contain a
form , with different id:
Page 1:
Page 2:
Now, in the
my-page.xhtml , you have a . In the first case, the real ID of the input will be form1:foo , while in the second case, it will be form2:foo . This could create complex situations if you need a direct access to this component in Javascript or in Java (usingfindComponent("...") method).
If you use
prependId="false" (or on some components forceId="true" ), the real ID will be simply foo , and then your code will be simpler as you will not have to care about the container of the input field.
However, you will have to use this attribute carefully, as you may get a duplicate ID error if you use this
prepend attribute too often... |
1 comment:
golden goose sneakers
manolo blahnik shoes
longchamp bags
canada goose uk
off-white clothing
canada goose outlet
cheap nhl jerseys
christian louboutin shoes
canada goose jackets
hermes belts
zzzzz2018.7.28
Post a Comment