From 5564082dc21dbe83589f979073aadd746a62d53e Mon Sep 17 00:00:00 2001 From: NicolaIsotta Date: Wed, 3 May 2017 16:05:52 +0200 Subject: [PATCH 1/6] Never forbid b:formGroup Fix #751 --- .../component/formGroup/FormGroupRenderer.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/java/net/bootsfaces/component/formGroup/FormGroupRenderer.java b/src/main/java/net/bootsfaces/component/formGroup/FormGroupRenderer.java index 46e471c5a..ea5245891 100755 --- a/src/main/java/net/bootsfaces/component/formGroup/FormGroupRenderer.java +++ b/src/main/java/net/bootsfaces/component/formGroup/FormGroupRenderer.java @@ -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; @@ -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); From 469408d1a253c08425c7893a7a9e5b6b99844d95 Mon Sep 17 00:00:00 2001 From: thecoder4eu Date: Fri, 5 May 2017 09:02:50 +0200 Subject: [PATCH 2/6] Fix Bootstrap Slider (b:slider2) value doesnt change on Click ( #699 ) . --- .../component/slider2/Slider2Renderer.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/bootsfaces/component/slider2/Slider2Renderer.java b/src/main/java/net/bootsfaces/component/slider2/Slider2Renderer.java index 954fbe248..ef09296dd 100644 --- a/src/main/java/net/bootsfaces/component/slider2/Slider2Renderer.java +++ b/src/main/java/net/bootsfaces/component/slider2/Slider2Renderer.java @@ -234,7 +234,7 @@ private void encodeHTML(Slider2 slider, FacesContext context, ResponseWriter rw) rw.endElement("div"); // rw.write("\n");//form-group - encodeJS(slider, rw, clientId); + encodeJS(slider, rw, clientId, mode); Tooltip.activateTooltips(context, slider); } @@ -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(":", "_"); @@ -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"); From b6d17091d05fe1b2a8f903283be749e7590dffc1 Mon Sep 17 00:00:00 2001 From: NicolaIsotta Date: Fri, 5 May 2017 18:07:00 +0200 Subject: [PATCH 3/6] Use caption when building the error message Fix #763 --- .../SelectBooleanCheckboxRenderer.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java b/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java index 7739990af..61cbaf124 100644 --- a/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java +++ b/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java @@ -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; @@ -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); } @@ -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)) { @@ -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"); } } @@ -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"); } @@ -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); + } } /** @@ -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"); } From 0d341bb4c613971db06435096c1cf612cab4a0e0 Mon Sep 17 00:00:00 2001 From: thecoder4eu Date: Sat, 6 May 2017 16:20:50 +0200 Subject: [PATCH 4/6] Set release status for Release --- build.properties | 2 +- pom.xml | 2 +- src/main/java/net/bootsfaces/C.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.properties b/build.properties index 61466306b..032ddf53b 100644 --- a/build.properties +++ b/build.properties @@ -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 diff --git a/pom.xml b/pom.xml index b8fd7cd19..c50c72731 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.bootsfaces bootsfaces - 1.1.1-SNAPSHOT + 1.1.1 BootsFaces TheCoder4EU http://www.bootsfaces.net diff --git a/src/main/java/net/bootsfaces/C.java b/src/main/java/net/bootsfaces/C.java index b734582a0..72eb9e836 100644 --- a/src/main/java/net/bootsfaces/C.java +++ b/src/main/java/net/bootsfaces/C.java @@ -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"; From 2c87f1608f7fb8ea00b3c5644283a14f874d05ce Mon Sep 17 00:00:00 2001 From: NicolaIsotta Date: Mon, 15 May 2017 16:10:37 +0200 Subject: [PATCH 5/6] Don't ignore f:selectItem value Fix #780 --- .../bootsfaces/component/SelectItemUtils.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/bootsfaces/component/SelectItemUtils.java b/src/main/java/net/bootsfaces/component/SelectItemUtils.java index 54c566059..53c55f649 100644 --- a/src/main/java/net/bootsfaces/component/SelectItemUtils.java +++ b/src/main/java/net/bootsfaces/component/SelectItemUtils.java @@ -93,13 +93,16 @@ public static List 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; } From 23156acf28a835c66f48742b7559cc80a8a0951c Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 19 May 2017 21:21:26 +0200 Subject: [PATCH 6/6] #784 corrected the *.jsfdsl file and re-ran the code generator --- .../net/bootsfaces/component/growl/Growl.java | 2 +- .../meta/META-INF/bootsfaces-b.taglib.xml | 176 +++++++++--------- xtext/BootsFaces.jsfdsl | 4 +- 3 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/main/java/net/bootsfaces/component/growl/Growl.java b/src/main/java/net/bootsfaces/component/growl/Growl.java index 2d541555e..226a5372e 100644 --- a/src/main/java/net/bootsfaces/component/growl/Growl.java +++ b/src/main/java/net/bootsfaces/component/growl/Growl.java @@ -38,7 +38,7 @@ public Growl() { AddResourcesListener.addThemedCSSResource("core.css"); AddResourcesListener.addExtCSSResource("animate.css"); } - + public String getFamily() { return COMPONENT_FAMILY; } diff --git a/src/main/meta/META-INF/bootsfaces-b.taglib.xml b/src/main/meta/META-INF/bootsfaces-b.taglib.xml index 28ddfcea2..fbe007d1f 100644 --- a/src/main/meta/META-INF/bootsfaces-b.taglib.xml +++ b/src/main/meta/META-INF/bootsfaces-b.taglib.xml @@ -6,7 +6,7 @@ version="2.0" id="b"> http://bootsfaces.net/ui - + accordion @@ -308,7 +308,7 @@ java.lang.String - + alert @@ -610,7 +610,7 @@ java.lang.String - + badge @@ -900,7 +900,7 @@ java.lang.String - + button @@ -1430,7 +1430,7 @@ java.lang.String - + buttonGroup @@ -1744,7 +1744,7 @@ java.lang.String - + buttonToolbar @@ -2046,7 +2046,7 @@ java.lang.String - + canvas @@ -2348,7 +2348,7 @@ java.lang.Integer - + carousel @@ -2800,7 +2800,7 @@ java.lang.Boolean - + carouselItem @@ -3006,7 +3006,7 @@ java.lang.String - + carouselCaption @@ -3200,7 +3200,7 @@ java.lang.String - + carouselControl @@ -3400,7 +3400,7 @@ java.lang.String - + colorPicker @@ -4110,7 +4110,7 @@ java.lang.String - + column @@ -4406,7 +4406,7 @@ java.lang.String - + commandButton @@ -4972,7 +4972,7 @@ java.lang.String - + container @@ -5100,7 +5100,7 @@ java.lang.String - + dataTable @@ -5714,7 +5714,7 @@ String - + dataTableColumn @@ -5938,7 +5938,7 @@ java.lang.String - + datepicker @@ -6480,7 +6480,7 @@ java.lang.String - + dateTimePicker @@ -7466,7 +7466,7 @@ java.lang.String - + defaultCommand @@ -7492,7 +7492,7 @@ java.lang.String - + dropButton @@ -7812,7 +7812,7 @@ java.lang.String - + dropMenu @@ -8222,7 +8222,7 @@ java.lang.String - + fetchBeanInfos @@ -8236,7 +8236,7 @@ java.lang.String - + form @@ -8418,7 +8418,7 @@ java.lang.String - + flyOutMenu @@ -8546,7 +8546,7 @@ java.lang.String - + focus @@ -8572,7 +8572,7 @@ java.lang.String - + fullCalendar @@ -9000,7 +9000,7 @@ java.lang.Boolean - + growl @@ -9127,6 +9127,12 @@ false java.lang.Boolean + + + severity + false + java.lang.String + show-detail @@ -9175,14 +9181,8 @@ false java.lang.Integer - - - severity - false - java.lang.String - - + gyroscope @@ -9280,7 +9280,7 @@ java.lang.String - + icon @@ -9678,7 +9678,7 @@ java.lang.String - + iconAwesome @@ -10070,7 +10070,7 @@ java.lang.String - + image @@ -10504,7 +10504,7 @@ java.lang.String - + inputSecret @@ -11220,7 +11220,7 @@ java.lang.String - + inputText @@ -12014,7 +12014,7 @@ java.lang.String - + inputTextarea @@ -12724,7 +12724,7 @@ java.lang.String - + internalFALink @@ -12732,7 +12732,7 @@ net.bootsfaces.component.internalFALink.InternalFALink - + internalIE8CompatibilityLink @@ -12740,7 +12740,7 @@ net.bootsfaces.component.internalIE8CompatibilityLink.InternalIE8CompatibilityLink - + jumbotron @@ -12856,7 +12856,7 @@ java.lang.String - + kebab @@ -12912,7 +12912,7 @@ java.lang.String - + label @@ -13214,7 +13214,7 @@ java.lang.String - + listLinks @@ -13324,7 +13324,7 @@ java.lang.String - + message @@ -13728,7 +13728,7 @@ java.lang.String - + messages @@ -14035,6 +14035,12 @@ false java.lang.Boolean + + + severity + false + java.lang.String + show-detail @@ -14215,14 +14221,8 @@ false java.lang.String - - - severity - false - java.lang.String - - + modal @@ -14344,7 +14344,7 @@ java.lang.String - + navBar @@ -14616,7 +14616,7 @@ java.lang.String - + navCommandLink @@ -15194,7 +15194,7 @@ java.lang.String - + navLink @@ -15778,7 +15778,7 @@ java.lang.String - + navbarLinks @@ -15906,7 +15906,7 @@ java.lang.String - + panel @@ -16394,7 +16394,7 @@ java.lang.String - + panelGrid @@ -16738,7 +16738,7 @@ java.lang.String - + pillLinks @@ -16848,7 +16848,7 @@ java.lang.String - + poll @@ -16910,7 +16910,7 @@ java.lang.String - + progressBar @@ -17254,7 +17254,7 @@ java.lang.String - + radiobutton @@ -17640,7 +17640,7 @@ java.lang.String - + remoteCommand @@ -17750,7 +17750,7 @@ java.lang.String - + row @@ -17872,7 +17872,7 @@ java.lang.String - + scrollUp @@ -17970,7 +17970,7 @@ java.lang.String - + scrollSpy @@ -18038,7 +18038,7 @@ java.lang.String - + selectBooleanCheckbox @@ -18694,7 +18694,7 @@ java.lang.String - + shake @@ -18774,7 +18774,7 @@ java.lang.String - + spinner @@ -19160,7 +19160,7 @@ java.lang.String - + switch @@ -19840,7 +19840,7 @@ java.lang.String - + selectMultiMenu @@ -20628,7 +20628,7 @@ java.lang.String - + selectOneMenu @@ -21260,7 +21260,7 @@ java.lang.String - + slider @@ -21502,7 +21502,7 @@ java.lang.String - + slider2 @@ -21756,7 +21756,7 @@ java.lang.Integer - + socialShare @@ -22040,7 +22040,7 @@ java.lang.String - + touchSpin @@ -22984,7 +22984,7 @@ java.lang.String - + tab @@ -23166,7 +23166,7 @@ java.lang.String - + tabLinks @@ -23276,7 +23276,7 @@ java.lang.String - + tabView @@ -23512,7 +23512,7 @@ java.lang.String - + tree @@ -23892,7 +23892,7 @@ java.lang.String - + thumbnail @@ -24176,7 +24176,7 @@ java.lang.String - + video @@ -24669,7 +24669,7 @@ java.lang.String - + well @@ -24965,7 +24965,7 @@ java.lang.String - + formGroup diff --git a/xtext/BootsFaces.jsfdsl b/xtext/BootsFaces.jsfdsl index bb09ecba8..51c1aa41f 100644 --- a/xtext/BootsFaces.jsfdsl +++ b/xtext/BootsFaces.jsfdsl @@ -835,8 +835,8 @@ widget growl newest-on-top Boolean "Specifies if newest messages must be displayed on top of the others." allow-dismiss Boolean "Specifies whether the message can be dismissed." escape Boolean "By default, error messages encode HTML and JavaScript code. Instead of being executed, the source code is displayed. This protects you against hacker attacks. By setting escape=false, you deactivate the protection, and allow HTML and JavaScript code to be rendered." + severity inherited "Comma separated list of lower case severity names of which messages should be rendered in this component. Allowed severity names \"info\", \"warn\", \"error\", \"fatal\". Default value: \"info,warn,error,fatal\" (all severities)." +style - severity "Comma separated list of lower case severity names of which messages should be rendered in this component. Allowed severity names \"info\", \"warn\", \"error\", \"fatal\". Default value: \"info,warn,error,fatal\" (all severities)." } widget gyroscope @@ -1297,8 +1297,8 @@ widget messages tooltip-position "Where is the tooltip to be displayed? Possible values: \"top\", \"bottom\", \"right\", \"left\", \"auto\", \"auto top\", \"auto bottom\", \"auto right\" and \"auto left\". Default to \"bottom\"." warn-class "CSS class to be used for messages with severity \"WARN\"." warn-style "CSS style to be used for messages with severity \"WARN\"." + severity inherited "Comma separated list of lower case severity names of which messages should be rendered in this component. Allowed severity names \"info\", \"warn\", \"error\", \"fatal\". Default value: \"info,warn,error,fatal\" (all severities)." +responsive - severity "Comma separated list of lower case severity names of which messages should be rendered in this component. Allowed severity names \"info\", \"warn\", \"error\", \"fatal\". Default value: \"info,warn,error,fatal\" (all severities)." }