Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag to declare and import constants in EL scope #1424

Closed
eclipse-faces-bot opened this issue Jun 20, 2016 · 6 comments
Closed

Tag to declare and import constants in EL scope #1424

eclipse-faces-bot opened this issue Jun 20, 2016 · 6 comments

Comments

@eclipse-faces-bot
Copy link

This is a commonly requested feature from the community. OmniFaces has o:importConstants, PrimeFaces Extensions has pe:importConstants and pe:importEnum. EL 3.0 offers ImportHandler#importClass(). It would be nice to offer a standard JSF solution such as <f:importConstants>. It's relatively trivial to implement.

Use case:

public enum Gender { MALE, FEMALE, UNKNOWN; }
<f:importConstants type="com.example.Gender" />
<h:selectOneMenu value="#{person.gender}">
    <f:selectItems value="#{Gender}" />
</h:selectOneMenu>

Affected Versions

[2.2]

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
Reported by @BalusC

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@BalusC said:
As per mailing list discussion:

  • Enforce it as child of <f:metadata> (like viewparam).
  • Put constant values in application scope, not request/view/session.
  • Allow configuration/override via faces-config.xml.

Additional detail:

  • Use var attribute to override name of scoped variable.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@BalusC said:
<f:importConstants> has been implemented https://java.net/projects/mojarra/sources/git/revision/7e903356fb88df14228f7cf24130c3dd59f0350a

Only configuration/override via faces-config.xml has not been implemented. After all, I'm not really seeing how that's useful.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
Marked as fixed on Monday, June 27th 2016, 3:04:06 am

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1424

@eclipse-faces-bot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant