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

o:importConstants not applied to method arguments in EL #98

Closed
RayDeCampo opened this Issue Feb 12, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@RayDeCampo

RayDeCampo commented Feb 12, 2015

I tried using importConstants on an Enum and then passing the imported value to a method like so:

<o:importConstants type="my.enum.class.Role" />
This worked: #{Role.operator}
This passed null to the method: #{cc.attrs.user.roles.contains(Role.operator)}

I was inside a composite component (not sure if relevant). Passed in a User object with a roles attribute which is Set.

I am using OmniFaces 2.0 and WildFly 8.2.0.Final with the stock JSF/EL libraries (Mojarra 2.2.8 and what looks like the GlassFish EL implementation version 3.0.1-b05).

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Mar 2, 2015

Member

It's put in Facelet scope, which is kind of weird/buggy in composite components in Mojarra. It should work when declared in the template client containing the composite. This all works fine in MyFaces.

One way to bypass it would be putting it in the request scope instead of Facelet scope. @arjantijms What do you think about this one?

Member

BalusC commented Mar 2, 2015

It's put in Facelet scope, which is kind of weird/buggy in composite components in Mojarra. It should work when declared in the template client containing the composite. This all works fine in MyFaces.

One way to bypass it would be putting it in the request scope instead of Facelet scope. @arjantijms What do you think about this one?

@BalusC BalusC closed this in ceb50e7 Mar 17, 2015

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Mar 17, 2015

Member

Fix is available in today's latest 2.1 snapshot.

Member

BalusC commented Mar 17, 2015

Fix is available in today's latest 2.1 snapshot.

VsevolodGolovanov pushed a commit to VsevolodGolovanov/omnifaces that referenced this issue May 18, 2016

s.golovanov
Revert "Fix #98 let importConstants put in request scope instead of f…
…acelet"

This reverts commit ceb50e7.

Conflicts:
	src/main/java/org/omnifaces/taghandler/ImportConstants.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment