[
https://issues.jboss.org/browse/SEAMFACES-95?page=com.atlassian.jira.plug...
]
Brian Leathem edited comment on SEAMFACES-95 at 3/14/11 12:40 AM:
------------------------------------------------------------------
I think #{projectStage eq 'Development'} is clear, and stable, despite not being
typesafe. But then nothing is really type-safe in EL anyway.
If there is a continued desire to have the project stage enums exposed via a map, then
please re-open this ticket.
was (Author: bleathem):
I think #{projectStage eq 'Development'} is clear, and stable, despite not
being typesafe. But then nothing is really type-safe in EL anyway.
If their is a continued desire to have the project stage enums exposed via a map, then
please re-open this ticket.
Make ProjectStage available from EL
-----------------------------------
Key: SEAMFACES-95
URL:
https://issues.jboss.org/browse/SEAMFACES-95
Project: Seam Faces
Issue Type: Feature Request
Components: CDI Integration
Affects Versions: 3.0.0.CR1
Reporter: Dan Allen
Assignee: Brian Leathem
Priority: Minor
Fix For: 3.0.0.Final
There is no easy way to reach the project stage from EL, nor can you easily check which
ProjectStage is active. The only way to access the ProjectStage is by referencing the
context parameter directly:
#{initParam['javax.faces.PROJECT_STAGE']}
Seam Faces should make it available as
#{projectStage}
This also makes it possible to check which project stage is active.
#{projectStage eq 'Development'}
Without an implicit projectStage variable, that's not possible via EL, even with
method parameters, because the signature of the comparison method is as follows:
FacesContext#isProjectStage(ProjectStage)
Since enums can't be referenced directly from EL (without an explicit producer),
there is no way to use this method. Thus, it might make sense to expose a project stage
map that allows the enum values to be referenced:
#{projectStages.Development}
Then it would be possible to execute:
#{facesContext.isProjectStage(projectStages.Production)}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira