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

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

Projects

None yet

2 participants

@RayDeCampo

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
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
Member
BalusC commented Mar 17, 2015

Fix is available in today's latest 2.1 snapshot.

@VsevolodGolovanov 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
47c6621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment