Type: New Feature
Affects Version/s: None
Fix Version/s: None
In JSF a component can put a variable into a scope to make it usable for its child components, or possibly other components on the page.
In this example the ui:repeat component selects a value from someBean.items and makes that available under the name item.
In order for tools to validate the correctness of the item.name expression, they currently make use of hardcoded knowledge of what well known components do. This means that components from libraries that are not explicitly supported by such tools can't be validated. Custom components made by users are thus never validated.
I would like to propose adding a mechanism to JSF for components to declare they make (scoped) variables available.
In this example, the component declares that the var attribute is the name for data that is made available during the 'scope of the component' and that the type of this data is an element from the value attribute.
Additionally, it should also be possible that a fixed type is specified, e.g:
Of course the given syntax is just a quick sketch of the idea. Maybe @VariableExportName is a better name, @VariableSource might not be needed, etc.
This issue is somewhat related to