Skip to content

Commit

Permalink
Fixed bug TheCoder4eu#321 (not rendering hidden-md), TheCoder4eu#326
Browse files Browse the repository at this point in the history
…(disable attribute in

datepicker) and TheCoder4eu#329 problem in CoreRenderer for EL expression in value
attribute.
  • Loading branch information
asterd committed Mar 21, 2016
1 parent 44568ad commit b8270fc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/main/java/net/bootsfaces/component/DatePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ private void encodeJS(FacesContext fc, ResponseWriter rw, String cId, String dpI
if (mode.equals("toggle-icon") || mode.equals("icon-toggle")) {
sb.append(JQ.SHOWON).append(":").append("'" + "button" + "'").append(",");
}
if(A.toBool(attrs.get(JQ.DTDISABLED))) {
sb.append(JQ.DTDISABLED).append(":").append("true").append(",");
}

/*
* Attributes that need decoding the Date
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/net/bootsfaces/component/badge/Badge.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public class Badge extends UIOutput {
private Map<String, Object> attributes;

public Badge() {


setRendererType(DEFAULT_RENDERER);
}

Expand All @@ -62,10 +60,10 @@ public Map<String, Object> getAttributes() {
}

protected enum PropertyKeys {
binding,
style,
styleClass
;
binding,
style,
styleClass
;

String toString;

Expand Down
19 changes: 16 additions & 3 deletions src/main/java/net/bootsfaces/render/CoreRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,28 @@ public String getValue2Render(FacesContext fc, UIComponent c) {

// format the value as string
if (val != null) {
/* OLD
Converter converter = getConverter(fc, vh);

if (converter != null)
*/

/* NEW */
Converter converter = vh.getConverter();
if (converter == null) {
Class<?> valueType = val.getClass();
if(valueType == String.class) {
return (String) val;
}

converter = fc.getApplication().createConverter(valueType);
}
/* END NEW */

if (converter != null)
return converter.getAsString(fc, c, val);
else
return val.toString(); // Use toString as a fallback if
// there is no explicit or implicit
// converter

} else {
// component is a value holder but has no value
return null;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/bootsfaces/render/JQ.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public static void simpleSlider(ResponseWriter rw, String cId, String opts, bool
public static final String CHNGYEAR = "changeYear"; //Bool
public static final String SHOWWK = "showWeek"; //Bool
public static final String DTFORMAT = "dateFormat";
public static final String DTDISABLED = "disabled"; //Bool
/*
* Default: "c-10:c+10"
* The range of years displayed in the year drop-down:
Expand Down

0 comments on commit b8270fc

Please sign in to comment.