[seam-issues] [JBoss JIRA] Commented: (SEAMFACES-95) Make ProjectStage available from EL

Brian Leathem (JIRA) jira-events at lists.jboss.org
Sun Mar 13 23:19:45 EDT 2011


    [ https://issues.jboss.org/browse/SEAMFACES-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587639#comment-12587639 ] 

Brian Leathem commented on SEAMFACES-95:
----------------------------------------

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


More information about the seam-issues mailing list