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/06/09 16:10:25 UTC

[GitHub] [myfaces-tobago] JasminKroeger opened a new pull request #123: add disable attribute for tc:buttons and tc:links

JasminKroeger opened a new pull request #123:
URL: https://github.com/apache/myfaces-tobago/pull/123


   * add setter for disable attribute in ButtonsTagDeclaration and LinksTagDeclaration
   * create Interface to set and get disabled
   * adjust Renderer to write disabled attribute in tag
   * adjust isDisabled in AbstractUICommandBase to check if the parent is disabled. If the parent is disabled all all children are disabled. If a child has the disabled attribute set, than the child is not disabled.
   * create example in demo
   
   ISSUE: TOBAGO-1997


----------------------------------------------------------------
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



[GitHub] [myfaces-tobago] lofwyr14 commented on a change in pull request #123: add disable attribute for tc:buttons and tc:links

Posted by GitBox <gi...@apache.org>.
lofwyr14 commented on a change in pull request #123:
URL: https://github.com/apache/myfaces-tobago/pull/123#discussion_r437268286



##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/component/SupportsDisabledProperty.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.component;
+
+public interface SupportsDisabledProperty {

Review comment:
       Naming thing: Other similiar interfaces doesn't have the "Property" suffix in the name. Please change to "SupportsDisabled".




----------------------------------------------------------------
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



[GitHub] [myfaces-tobago] lofwyr14 merged pull request #123: add disable attribute for tc:buttons and tc:links

Posted by GitBox <gi...@apache.org>.
lofwyr14 merged pull request #123:
URL: https://github.com/apache/myfaces-tobago/pull/123


   


----------------------------------------------------------------
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



[GitHub] [myfaces-tobago] henningn commented on a change in pull request #123: add disable attribute for tc:buttons and tc:links

Posted by GitBox <gi...@apache.org>.
henningn commented on a change in pull request #123:
URL: https://github.com/apache/myfaces-tobago/pull/123#discussion_r439454604



##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUILinks.java
##########
@@ -19,12 +19,28 @@
 
 package org.apache.myfaces.tobago.internal.component;
 
+import org.apache.myfaces.tobago.component.SupportsDisabled;
 import org.apache.myfaces.tobago.layout.Orientation;
 
 /**
  * {@link org.apache.myfaces.tobago.internal.taglib.component.LinksTagDeclaration}
  */
-public abstract class AbstractUILinks extends AbstractUIPanelBase {
+public abstract class AbstractUILinks extends AbstractUIPanelBase implements SupportsDisabled {
+
+  enum PropertyKeys {
+    disabled,
+  }
 
   public abstract Orientation getOrientation();
+
+  @Override
+  public boolean isDisabled() {

Review comment:
       I think getter/setter for disabled could be generated. So it's no need to implement it here.

##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIButtons.java
##########
@@ -19,12 +19,28 @@
 
 package org.apache.myfaces.tobago.internal.component;
 
+import org.apache.myfaces.tobago.component.SupportsDisabled;
 import org.apache.myfaces.tobago.layout.Orientation;
 
 /**
  * {@link org.apache.myfaces.tobago.internal.taglib.component.ButtonsTagDeclaration}
  */
-public abstract class AbstractUIButtons extends AbstractUIPanelBase {
+public abstract class AbstractUIButtons extends AbstractUIPanelBase implements SupportsDisabled {
+
+  enum PropertyKeys {
+    disabled,
+  }
 
   public abstract Orientation getOrientation();
+
+  @Override
+  public boolean isDisabled() {

Review comment:
       I think getter/setter for disabled could be generated. So it's no need to implement it here.

##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinksRenderer.java
##########
@@ -48,6 +49,9 @@ public void encodeBegin(final FacesContext facesContext, final UIComponent compo
         getExtraCssItem(),
         Orientation.vertical.equals(links.getOrientation()) ? BootstrapClass.FLEX_COLUMN : null,
         links.getCustomClass());
+    if (links.isDisabled()) {

Review comment:
       The HTML DIV tag includes the global attributes but no "disabled" attribute.
   See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
   
   Imho the "disabled" attribute should not be rendered.

##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinksTagDeclaration.java
##########
@@ -43,4 +45,11 @@
     },
     rendererType = {RendererTypes.LINKS, RendererTypes.LINKS_INSIDE_BAR})
 public interface LinksTagDeclaration extends HasIdBindingAndRendered, IsVisual, HasTip, HasOrientation {
+
+  /**
+   * Flag indicating that this element and all children are disabled.
+   */
+  @TagAttribute()
+  @UIComponentTagAttribute(type = "boolean", generate = false)

Review comment:
       I think getter/setter for disabled could be generated. Remove "generate = false".

##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonsTagDeclaration.java
##########
@@ -46,4 +48,10 @@
 public interface ButtonsTagDeclaration
     extends HasIdBindingAndRendered, IsVisual, HasTip, HasOrientation {
 
+  /**
+   * Flag indicating that this element and all children are disabled.
+   */
+  @TagAttribute()
+  @UIComponentTagAttribute(type = "boolean", generate = false)

Review comment:
       I think getter/setter for disabled could be generated. Remove "generate = false".

##########
File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ButtonsRenderer.java
##########
@@ -57,6 +57,9 @@ public void encodeBegin(final FacesContext facesContext, final UIComponent compo
             ? BootstrapClass.BTN_GROUP_VERTICAL : BootstrapClass.BTN_GROUP,
         buttons.getCustomClass());
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.GROUP.toString(), false);
+    if (buttons.isDisabled()) {

Review comment:
       The HTML DIV tag includes the global attributes but no "disabled" attribute.
   See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
   
   Imho the "disabled" attribute should not be rendered.




----------------------------------------------------------------
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