Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Invalid
-
Affects Version/s: None
-
Fix Version/s: EE-3.0.0.GA
-
Component/s: Facelet Components
-
Labels:None
-
Environment:ICEfaces 2.0 Beta 1, JSF 2.0.3, Glassfish 3.0.1, JDK 6.x
Description
When using a JSF 2.0 composite component that has an "id" attribute, the id will be rendered into the page instead of just passed through to the component. For example:
<div id="parentCon">
<ice-cc:filterTable id="ourTable" bean="..."/>
</div>
Then the component code itself:
...
<ice:dataTable id="#{cc.attrs.id}"...
...
We would expect the id of the composite component dataTable to be "parentCon:ourTable". Instead it appears to render as "parentCon:ourTable:ourTable", because the id of the filterTable composite component is being rendered into the page as well. Basically "id" looks like a reserved name that can't be freely used as a composite component attribute.
To workaround you could use a different attribute name, for example 'fakeId="ourTable"' would properly render in the above example as "parentCon:ourTable". This breaks backwards compatibility and is more confusing for a user to work with.
Also note this issue causes problems for components that rely on id, such as the "for" of a dataPaginator.
<div id="parentCon">
<ice-cc:filterTable id="ourTable" bean="..."/>
</div>
Then the component code itself:
...
<ice:dataTable id="#{cc.attrs.id}"...
...
We would expect the id of the composite component dataTable to be "parentCon:ourTable". Instead it appears to render as "parentCon:ourTable:ourTable", because the id of the filterTable composite component is being rendered into the page as well. Basically "id" looks like a reserved name that can't be freely used as a composite component attribute.
To workaround you could use a different attribute name, for example 'fakeId="ourTable"' would properly render in the above example as "parentCon:ourTable". This breaks backwards compatibility and is more confusing for a user to work with.
Also note this issue causes problems for components that rely on id, such as the "for" of a dataPaginator.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
In JSF 2 Components, the id 'attribute' is inherent, but not considered an attribute. That means you don't have to declare it, and you can access either by #
{cc.id}(note, not accessed through the cc.attrs property) and #
{cc.clientId}properties.