-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
default value of render-label can now be configured in the web.xml again
- Loading branch information
1 parent
1200bd5
commit 2c6f87f
Showing
12 changed files
with
4,207 additions
and
4,193 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/net/bootsfaces/component/ComponentUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.bootsfaces.component; | ||
|
||
import javax.faces.bean.ManagedBean; | ||
import javax.faces.bean.RequestScoped; | ||
import javax.faces.context.FacesContext; | ||
|
||
import net.bootsfaces.beans.ELTools; | ||
|
||
@ManagedBean | ||
@RequestScoped | ||
public class ComponentUtils { | ||
private boolean renderLabelDefault = true; | ||
|
||
public ComponentUtils() { | ||
String renderLabel = FacesContext.getCurrentInstance().getExternalContext() | ||
.getInitParameter("net.bootsfaces.defaults.renderLabel"); | ||
if (null != renderLabel && renderLabel.contains("#{")) { | ||
renderLabelDefault = (Boolean) ELTools.evalAsObject(renderLabel); | ||
} | ||
else if (null != renderLabel) { | ||
renderLabelDefault = Boolean.valueOf(renderLabel); | ||
} | ||
} | ||
|
||
public static boolean isRenderLabelDefault() { | ||
ComponentUtils cu = (ComponentUtils) ELTools.evalAsObject("#{componentUtils}"); | ||
return cu.renderLabelDefault; | ||
} | ||
} |
Oops, something went wrong.