You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2020/04/16 07:48:29 UTC
[GitHub] [myfaces-tobago] JasminKroeger opened a new pull request #71:
update toggle, checkbox and radio buttons to Bootstrap 4.2
JasminKroeger opened a new pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71
* add Bootstrap classes
* remove * from toggles and checkboxes on required fields. The * is only on the label.
* add for attribute for labels
* order of input and label changed
* remove fontawesome icon
Issue: TOBAGO-1969
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410157967
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
##########
@@ -84,16 +84,22 @@ protected void encodeBeginField(final FacesContext facesContext, final UICompone
final LabelWithAccessKey label = new LabelWithAccessKey(select, true);
final String itemLabel = select.getItemLabel();
final Markup markup = select.getMarkup();
+ final BootstrapClass divBootstrapClass;
writer.startElement(HtmlElements.DIV);
if (select.isLabelLayoutSkip()) {
writer.writeIdAttribute(clientId);
}
+ if (isToggle()) {
+ divBootstrapClass = BootstrapClass.CUSTOM_SWITCH;
Review comment:
The The CUSTOM_SWITCH css class should be set in getOuterCssItems() method of the SelectBooleanToggleRenderer
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410259990
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
##########
@@ -84,6 +84,7 @@ protected void encodeBeginField(final FacesContext facesContext, final UICompone
final LabelWithAccessKey label = new LabelWithAccessKey(select, true);
final String itemLabel = select.getItemLabel();
final Markup markup = select.getMarkup();
+ final BootstrapClass divBootstrapClass;
Review comment:
variable not used; can be removed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410159978
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
##########
@@ -165,4 +171,8 @@ protected String getFieldId(final FacesContext facesContext, final UIComponent c
final AbstractUISelectBoolean select = (AbstractUISelectBoolean) component;
return select.getFieldId(facesContext);
}
+
+ protected Boolean isToggle() {
Review comment:
Don't use this to decide which component should be renderen. Use the SelectBooleanCheckboxRenderer only to render a checkbox and the SelectBooleanToggleRenderer to render a toggle.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410260591
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java
##########
@@ -248,10 +248,17 @@
COL_XS_12("col-12"),
CONTAINER("container"),
CONTAINER_FLUID("container-fluid"),
+ CUSTOM_CHECKBOX("custom-checkbox"),
+ CUSTOM_CONTROL("custom-control"),
+ CUSTOM_CONTROL_LABEL("custom-control-label"),
+ CUSTOM_CONTROL_INLINE("custom-control-inline"),
+ CUSTOM_CONTROL_INPUT("custom-control-input"),
CUSTOM_FILE("custom-file"),
CUSTOM_FILE_INPUT("custom-file-input"),
CUSTOM_FILE_LABEL("custom-file-label"),
CUSTOM_SELECT("custom-select"),
+ CUSTOM_RADIO("custom-radio"),
Review comment:
please sort alphabetically
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410179982
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java
##########
@@ -93,10 +93,7 @@ protected void encodeBeginField(final FacesContext facesContext, final UICompone
inline ? BootstrapClass.FORM_CHECK_INLINE : null,
itemDisabled ? BootstrapClass.DISABLED : null);
}
- writer.startElement(HtmlElements.LABEL);
- writer.writeClassAttribute(
- BootstrapClass.FORM_CHECK_LABEL,
- getCssItems(facesContext, select));
+
writer.startElement(HtmlElements.INPUT);
writer.writeClassAttribute(BootstrapClass.FORM_CHECK_INPUT);
Review comment:
The css class should be changed to: BootstrapClass.CUSTOM_CONTROL_INPUT
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410153119
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxInsideCommandRenderer.java
##########
@@ -45,7 +45,8 @@ public void encodeEnd(final FacesContext facesContext, final UIComponent compone
}
@Override
- protected CssItem[] getOuterCssItems(final FacesContext facesContext, final AbstractUISelectBoolean select) {
+ protected CssItem[] getOuterCssItems(final FacesContext facesContext, final AbstractUISelectBoolean select,
+ final BootstrapClass bootstrapClass) {
Review comment:
Why is _final BootstrapClass bootstrapClass_ added?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410153715
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
##########
@@ -146,14 +152,14 @@ protected void encodeEndField(final FacesContext facesContext, final UIComponent
final TobagoResponseWriter writer = getResponseWriter(facesContext);
final AbstractUISelectBoolean select = (AbstractUISelectBoolean) component;
- writer.endElement(HtmlElements.LABEL);
writer.endElement(HtmlElements.DIV);
encodeBehavior(writer, facesContext, select);
}
- protected CssItem[] getOuterCssItems(final FacesContext facesContext, final AbstractUISelectBoolean select) {
- return new CssItem[]{BootstrapClass.FORM_CHECK};
+ protected CssItem[] getOuterCssItems(final FacesContext facesContext, final AbstractUISelectBoolean select,
+ final BootstrapClass bootstrapClass) {
Review comment:
Why is _final BootstrapClass bootstrapClass_ added?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410157659
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
##########
@@ -84,16 +84,22 @@ protected void encodeBeginField(final FacesContext facesContext, final UICompone
final LabelWithAccessKey label = new LabelWithAccessKey(select, true);
final String itemLabel = select.getItemLabel();
final Markup markup = select.getMarkup();
+ final BootstrapClass divBootstrapClass;
writer.startElement(HtmlElements.DIV);
if (select.isLabelLayoutSkip()) {
writer.writeIdAttribute(clientId);
}
+ if (isToggle()) {
+ divBootstrapClass = BootstrapClass.CUSTOM_SWITCH;
+ } else {
+ divBootstrapClass = BootstrapClass.CUSTOM_CHECKBOX;
Review comment:
The CUSTOM_CHECKBOX css class should be set in getOuterCssItems()
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn merged pull request #71: update toggle,
checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn merged pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [myfaces-tobago] henningn commented on a change in pull request
#71: update toggle, checkbox and radio buttons to Bootstrap 4.2
Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #71: update toggle, checkbox and radio buttons to Bootstrap 4.2
URL: https://github.com/apache/myfaces-tobago/pull/71#discussion_r410180647
##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java
##########
@@ -121,10 +118,11 @@ protected void encodeBeginField(final FacesContext facesContext, final UICompone
writer.writeAttribute(HtmlAttributes.TABINDEX, select.getTabIndex());
writer.endElement(HtmlElements.INPUT);
- writer.startElement(HtmlElements.I);
- writer.writeClassAttribute(TobagoClass.INPUT_PSEUDO);
- writer.endElement(HtmlElements.I);
-
+ writer.startElement(HtmlElements.LABEL);
+ writer.writeClassAttribute(
+ BootstrapClass.FORM_CHECK_LABEL,
Review comment:
The css class should be changed to: BootstrapClass.CUSTOM_CONTROL_LABEL
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services