Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jepsar committed May 20, 2017
2 parents ccf0dde + 1e5b5ae commit 59d4223
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 122 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ VERSION=1.1.1
# RELEASE-STATUS - SNAPSHOT , beta1, rc1 ...
# or don't remove the property but just leave it blank for a Final RELEASE :
# RELEASE-STATUS=
RELEASE-STATUS=SNAPSHOT
RELEASE-STATUS=
bootstrap.version=3.3.7

# Set global properties for this build
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.bootsfaces</groupId>
<artifactId>bootsfaces</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>1.1.1</version>
<name>BootsFaces</name>
<description>TheCoder4EU</description>
<url>http://www.bootsfaces.net</url>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/bootsfaces/C.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class C {
* BootsFaces Library Constants
*/
public static final String BSFVERSION="1.1.1";
public static final String BSFRELEASE_STATUS="SNAPSHOT"; //SNAPSHOT or empty String (for a final RELEASE)
public static final String BSFRELEASE_STATUS=""; //SNAPSHOT or empty String (for a final RELEASE)
public static final String BSFCOMPONENT= "net.bootsfaces.component";
public static final String BSFLAYOUT = "net.bootsfaces.layout";
//public static final String BSFRENDER = "net.bootsfaces.render";
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/net/bootsfaces/component/SelectItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ public static List<SelectItemAndComponent> collectOptions(FacesContext context,
}

private static SelectItem toSelectItem(UISelectItem option) {
SelectItem item = new SelectItem();
item.setDescription(option.getItemDescription());
item.setDisabled(option.isItemDisabled());
item.setEscape(option.isItemEscaped());
item.setLabel(option.getItemLabel());
item.setNoSelectionOption(option.isNoSelectionOption());
item.setValue(option.getItemValue());
SelectItem item = (SelectItem) option.getValue();
if (item == null) {
item = new SelectItem();
item.setDescription(option.getItemDescription());
item.setDisabled(option.isItemDisabled());
item.setEscape(option.isItemEscaped());
item.setLabel(option.getItemLabel());
item.setNoSelectionOption(option.isNoSelectionOption());
item.setValue(option.getItemValue());
}
return item;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@
package net.bootsfaces.component.formGroup;

import java.io.IOException;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.FacesRenderer;
import net.bootsfaces.C;
import net.bootsfaces.component.form.Form;
import net.bootsfaces.render.CoreRenderer;
import static net.bootsfaces.render.CoreRenderer.beginDisabledFieldset;
import net.bootsfaces.render.IContentDisabled;
import net.bootsfaces.render.Tooltip;

Expand All @@ -47,14 +43,9 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
return;
}

// Verify that we are inside an horizontal form
if (getSurroundingForm(component, true) == null || !isHorizontalForm(component)) {
throw new FacesException("The " + FormGroup.COMPONENT_TYPE + " component with the id " + component.getClientId() + " must be inside an horizontal " + Form.COMPONENT_TYPE);
}

FormGroup formGroup = (FormGroup) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = formGroup.getClientId();
String clientId = formGroup.getClientId(context);

rw.startElement("div", formGroup);
Tooltip.generateTooltip(context, formGroup, rw);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/bootsfaces/component/growl/Growl.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Growl() {
AddResourcesListener.addThemedCSSResource("core.css");
AddResourcesListener.addExtCSSResource("animate.css");
}

public String getFamily() {
return COMPONENT_FAMILY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import net.bootsfaces.component.ajax.AJAXRenderer;
import net.bootsfaces.render.CoreInputRenderer;
import net.bootsfaces.render.CoreRenderer;
import net.bootsfaces.render.H;
import net.bootsfaces.render.R;
import net.bootsfaces.render.Responsive;
Expand Down Expand Up @@ -76,8 +75,11 @@ public void decode(FacesContext context, UIComponent component) {
FacesMessages.error(clientId, userDefinedMessage, userDefinedMessage);
} else {
String label = selectBooleanCheckbox.getLabel();
if (label==null || label.length()==0) {
label = clientId;
if (label == null || label.isEmpty()) {
label = selectBooleanCheckbox.getCaption();
if (label == null || label.isEmpty()) {
label = clientId;
}
}
FacesMessages.createErrorMessageFromResourceBundle(clientId, "javax.faces.component.UIInput.REQUIRED", label);
}
Expand Down Expand Up @@ -106,7 +108,7 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
}
SelectBooleanCheckbox selectBooleanCheckbox = (SelectBooleanCheckbox) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = selectBooleanCheckbox.getClientId();
String clientId = selectBooleanCheckbox.getClientId(context);

String span = null;
if (!isHorizontalForm(component)) {
Expand Down Expand Up @@ -174,7 +176,7 @@ protected void addLabel(ResponseWriter rw, String clientId, SelectBooleanCheckbo
* may be thrown by the response writer
*/
protected void closeColSpanDiv(ResponseWriter rw, String span) throws IOException {
if (span != null && span.trim().length()>0) {
if (span != null && span.trim().length() > 0) {
rw.endElement("div");
}
}
Expand Down Expand Up @@ -340,8 +342,9 @@ protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox select
throws IOException {
rw.endElement("input");
String caption = selectBooleanCheckbox.getCaption();
if (null != caption)
if (null != caption) {
rw.append(" " + caption);
}
rw.endElement("label");
rw.endElement("div");
}
Expand All @@ -362,8 +365,9 @@ protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox select
protected void renderInputTagValue(FacesContext context, ResponseWriter rw,
SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
String v = getValue2Render(context, selectBooleanCheckbox);
if (v != null && "true".equals(v))
if (v != null && "true".equals(v)) {
rw.writeAttribute("checked", v, null);
}
}

/**
Expand All @@ -379,7 +383,7 @@ protected void renderInputTagValue(FacesContext context, ResponseWriter rw,
*/
protected String startColSpanDiv(ResponseWriter rw, SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
String clazz = Responsive.getResponsiveStyleClass(selectBooleanCheckbox, false);
if (clazz!= null && clazz.trim().length()>0) {
if (clazz != null && clazz.trim().length() > 0) {
rw.startElement("div", selectBooleanCheckbox);
rw.writeAttribute("class", clazz, "class");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void encodeHTML(Slider2 slider, FacesContext context, ResponseWriter rw)

rw.endElement("div"); // rw.write("<!-- form-group -->\n");//form-group

encodeJS(slider, rw, clientId);
encodeJS(slider, rw, clientId, mode);
Tooltip.activateTooltips(context, slider);
}

Expand Down Expand Up @@ -365,7 +365,7 @@ private void encodeSliderInput(Slider2 slider, ResponseWriter rw, boolean vo, in
rw.endElement("div"); // Column
}

private void encodeJS(Slider2 slider, ResponseWriter rw, String clientId) throws IOException {
private void encodeJS(Slider2 slider, ResponseWriter rw, String clientId, String mode) throws IOException {

String fClientId = BsfUtils.escapeJQuerySpecialCharsInSelector(clientId);
String VarName = clientId.replace(":", "_");
Expand All @@ -384,13 +384,22 @@ private void encodeJS(Slider2 slider, ResponseWriter rw, String clientId) throws
"$('#" + fClientId + "').val(slideEvt.value); "+
"$('#" + fClientId + "_badge').text(slideEvt.value); "+
"}); ", null);
String fchange="$('#" + fClientId + "').val($('#" + fClientId + "_slider').val()); ";
if (mode.equals("badge")) {
fchange+="$('#" + fClientId + "_badge').text($('#" + fClientId + "_slider').val()); ";
}
//Fix #699
rw.writeText(
"$('#" + fClientId + "_slider').on('change', function() { " +
fchange +
"}); ", null);
rw.writeText(
"$('#" + fClientId + "').keyup(function(event) { " +
" var val = this.value; " +
" if(typeof val === 'string') val = Number(val); " +
" " + VarName + "_sv.setValue(val, true, true); " +
"}); ", null);

rw.writeText("});", null);
rw.endElement("script");

Expand Down
Loading

0 comments on commit 59d4223

Please sign in to comment.