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

Feature request: easily access context / application properties in EL #311

Closed
jepsar opened this Issue Sep 15, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@jepsar

jepsar commented Sep 15, 2016

I was writing this expression in a rendered attribute: #{facesContext.application.projectStage == 'Development'}. Then I remembered Faces#isDevelopment() and wondered if OmniFaces also offered a way to easily access this in EL. Could not find anything. In my project I'll be creating a bean to expose Faces#isDevelopment().

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 17, 2016

Member

One way is <o:importFunctions>.

<o:importFunctions type="org.omnifaces.util.Faces" />
<h:someComponent rendered="#{Faces:isDevelopment()}" />

I however do agree that something like a #{faces.development} would be useful. This is definitely possible with a custom ELResolver which delegates further to Faces utility class, so I'll keep the issue open.

Member

BalusC commented Sep 17, 2016

One way is <o:importFunctions>.

<o:importFunctions type="org.omnifaces.util.Faces" />
<h:someComponent rendered="#{Faces:isDevelopment()}" />

I however do agree that something like a #{faces.development} would be useful. This is definitely possible with a custom ELResolver which delegates further to Faces utility class, so I'll keep the issue open.

@jepsar

This comment has been minimized.

Show comment
Hide comment
@jepsar

jepsar Sep 19, 2016

Thanks! +1 for o:importFuctions I'll be using that.

jepsar commented Sep 19, 2016

Thanks! +1 for o:importFuctions I'll be using that.

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 25, 2016

Member

#{faces} is now available with among others #{faces.development}.

It's available in today's latest 2.6-SNAPSHOT

Member

BalusC commented Sep 25, 2016

#{faces} is now available with among others #{faces.development}.

It's available in today's latest 2.6-SNAPSHOT

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