Skip to content

Commit

Permalink
#621 improved the legacy support
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanrauh committed Mar 22, 2017
1 parent 1a23591 commit 566f7a8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public void decode(FacesContext context, UIComponent component, String component
if (component instanceof ActionSource) {
if (((ActionSource) component).isImmediate())
ajaxEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
} else if (component instanceof IImmediate) {
if (((IImmediate) component).isImmediate())
ajaxEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
component.queueEvent(ajaxEvent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ private String encodeHTML(FacesContext fc, ResponseWriter rw, DateTimePicker dtp
}

String divSuffix="";
String errorSeverityClass = FacesMessages.getErrorSeverityClass(clientId);
String errorSeverityClass = getFormGroupWithFeedback("", clientId);
// FacesMessages.getErrorSeverityClass(clientId);
if (null != responsiveStyleClass && responsiveStyleClass.trim().length()>0) {
rw.startElement("div", dtp);
if (!isHorizontalForm(dtp)) {
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/net/bootsfaces/utils/BsfUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import javax.faces.context.FacesContext;
import javax.xml.bind.DatatypeConverter;

import net.bootsfaces.beans.ELTools;
import net.bootsfaces.expressions.ExpressionResolver;

public class BsfUtils {
Expand Down Expand Up @@ -661,6 +662,19 @@ public static int getIntSliderValue(String value) {
*/
public static boolean isLegacyFeedbackClassesEnabled() {
String legacyErrorClasses = getInitParam("net.bootsfaces.legacy_error_classes");
legacyErrorClasses=evalELIfPossible(legacyErrorClasses);
return legacyErrorClasses.equalsIgnoreCase("true") || legacyErrorClasses.equalsIgnoreCase("yes");
}

private static String evalELIfPossible(String expression) {
if (expression != null) {
if (expression.contains("#")) {
expression = ELTools.evalAsString(expression).trim();
}
}
else
expression = "";
return expression;
}

}

0 comments on commit 566f7a8

Please sign in to comment.