You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2022/10/05 20:01:57 UTC

[GitHub] [ofbiz-framework] florianMo opened a new pull request, #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

florianMo opened a new pull request, #548:
URL: https://github.com/apache/ofbiz-framework/pull/548

   Add disabled support on all form field types
   
   Switch to `FlexibleStringExpander` (instead of boolean) to support dynamic attribute values
   
   OF-12678
   
   Improved: Add `disabled` support on all form field types 
   Fixed: bug in `tab-index` attribute implementation for some HTML macros
   
   ### Explanation
   
   Before this PR, `disabled` attribute on form fields is a `boolean`, and its support is not implemented on all eligible widgets : 
   ```
   <text disabled="false" />
   <text disabled="true" />
   ```
   
   Based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled, this PR implements dynamic `disabled` attribute for all relevant widgets : 
   ```
   <date-range disabled="true" /> // disabled
   <date-range disabled="${5==5}" /> // disabled
   <date-range disabled="false" /> // not disabled
   <date-range disabled="${5==6}" /> // not disabled
   ```
   
   In addition, in HTML macros, the `disabled` attribute is render as a `boolean` instead of a string (see https://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-642250288) : 
   ```
   <text disabled="true" /> // renders as : 
   <input disabled /> // instead of
   <input disbaled="true" />
   ```
   
   Thanks: Néréide team
   


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r990015094


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2799,6 +2811,26 @@ public String getValue(Map<String, Object> context) {
             return getModelFormField().getEntry(context);
         }
 
+        /**
+         * Gets disabled.
+         * @return the disabled
+         */
+        public FlexibleStringExpander getDisabled() {

Review Comment:
   right sorry I should have done the same here !



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r989212390


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2738,25 +2745,30 @@ public ModelForm getModelGrid(Map<String, Object> context) {
      */
     public static class HiddenField extends FieldInfo {
         private final FlexibleStringExpander value;
+        private final FlexibleStringExpander disabled;

Review Comment:
   It's not really common but you can imagine to have a `<input type="hidden" disabled />`, which is valid I think, according to the spec (this is why I added this field on `HiddenField`, to be complete). It renders as an invisible and not submitted field. Not very useful (event if I can imagine use cases where this could be handy), but since you can do it in HTML I thought we should support it.



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
danwatford commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r986044913


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -483,10 +483,17 @@ public String getConditionGroup() {
         return conditionGroup;
     }
 
-    public boolean getDisabled() {
+    public FlexibleStringExpander getDisabled() {
         return disabled;
     }
 
+    public String getDisabled(Map<String, Object> context) {

Review Comment:
   Can we have a boolean returned here?   ModelFormField is the authority on whether a field is disabled based on context. If the property value is empty then ModelFormField can consider the field as enabled.



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2738,25 +2745,30 @@ public ModelForm getModelGrid(Map<String, Object> context) {
      */
     public static class HiddenField extends FieldInfo {
         private final FlexibleStringExpander value;
+        private final FlexibleStringExpander disabled;

Review Comment:
   Is the disabled property relevant for hidden fields? If not then this is a chance to remove a few lines of code.



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -483,10 +483,17 @@ public String getConditionGroup() {
         return conditionGroup;
     }
 
-    public boolean getDisabled() {
+    public FlexibleStringExpander getDisabled() {

Review Comment:
   Perhaps rename this method to something like `getDisabledSpec` to indicate that it now contains the specification of how the enabled/disabled state of a field will be determined.
   
   If possible, keep this field private as caller should only really care if the field is disabled or not based on a given context.



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] danwatford merged pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
danwatford merged PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
danwatford commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r989905225


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2799,6 +2811,26 @@ public String getValue(Map<String, Object> context) {
             return getModelFormField().getEntry(context);
         }
 
+        /**
+         * Gets disabled.
+         * @return the disabled
+         */
+        public FlexibleStringExpander getDisabled() {

Review Comment:
   Can this be renamed `getDisabledSpec` to differentiate it from calling `getDisabled` with context arguments. (Similar to the change made to the `ModelFormField` class above.)
   
   Does anything use this method? If not, we should remove it or make it private.



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java:
##########
@@ -729,7 +729,7 @@ public String getConditionGroup() {
      * Gets disabled.*
      * @return the disabled
      */
-    public boolean getDisabled() {
+    public FlexibleStringExpander getDisabled() {

Review Comment:
   Rename to `getDisabledSpec` to indicate it is no longer returning the disabled status of a field.



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2799,6 +2811,26 @@ public String getValue(Map<String, Object> context) {
             return getModelFormField().getEntry(context);
         }
 
+        /**
+         * Gets disabled.
+         * @return the disabled
+         */
+        public FlexibleStringExpander getDisabled() {
+            return disabled;
+        }
+
+        /**
+         *
+         * @param context the context
+         * @return evaluated value
+         */
+        public String getDisabled(Map<String, Object> context) {

Review Comment:
   Should return a boolean based on whether the string evaluates to 'true', 'false', or empty (which would also be false).



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2738,25 +2745,30 @@ public ModelForm getModelGrid(Map<String, Object> context) {
      */
     public static class HiddenField extends FieldInfo {
         private final FlexibleStringExpander value;
+        private final FlexibleStringExpander disabled;

Review Comment:
   ok



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/RenderableFtlFormElementsBuilder.java:
##########
@@ -287,7 +287,7 @@ public RenderableFtl textField(final Map<String, Object> context, final ModelFor
                 .stringParameter("id", id)
                 .stringParameter("event", event != null ? event : "")
                 .stringParameter("action", action != null ? action : "")
-                .booleanParameter("disabled", disabled)
+                .stringParameter("disabled", String.valueOf(disabled))

Review Comment:
   I don't think this change is needed. FTL is able to accept boolean parameters. 
   One of the ideas behind RenderableFtl's parameters was to avoid encoding meaning in strings when other more focussed types, such as boolean an int, would do a better job. 



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r990044205


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/RenderableFtlFormElementsBuilder.java:
##########
@@ -287,7 +287,7 @@ public RenderableFtl textField(final Map<String, Object> context, final ModelFor
                 .stringParameter("id", id)
                 .stringParameter("event", event != null ? event : "")
                 .stringParameter("action", action != null ? action : "")
-                .booleanParameter("disabled", disabled)
+                .stringParameter("disabled", String.valueOf(disabled))

Review Comment:
   I'll switch to a `boolean` in `HtmlFormMacroLibrary.ftl`, it's a little bit cleaner indeed, so this change is no longer needed (vs comparing a `string` to `true` in the macros).



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r989212390


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2738,25 +2745,30 @@ public ModelForm getModelGrid(Map<String, Object> context) {
      */
     public static class HiddenField extends FieldInfo {
         private final FlexibleStringExpander value;
+        private final FlexibleStringExpander disabled;

Review Comment:
   It's not really common but you can imagine to have a `<input type="hidden" disabled />`, which is valid I think, according to the spec (this is why I added this field on `HiddenField`, to be complete). It renders as an invisible and not submitted field. Not very useful (though I can imagine use cases where this could be handy), but since you can do it in HTML I thought we should support it.



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r989743835


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -483,10 +483,17 @@ public String getConditionGroup() {
         return conditionGroup;
     }
 
-    public boolean getDisabled() {
+    public FlexibleStringExpander getDisabled() {
         return disabled;
     }
 
+    public String getDisabled(Map<String, Object> context) {

Review Comment:
   done @danwatford 



##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -483,10 +483,17 @@ public String getConditionGroup() {
         return conditionGroup;
     }
 
-    public boolean getDisabled() {
+    public FlexibleStringExpander getDisabled() {

Review Comment:
   done



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r989212390


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java:
##########
@@ -2738,25 +2745,30 @@ public ModelForm getModelGrid(Map<String, Object> context) {
      */
     public static class HiddenField extends FieldInfo {
         private final FlexibleStringExpander value;
+        private final FlexibleStringExpander disabled;

Review Comment:
   It's not really common but you can imagine to have a `<input type="hidden" disabled />`, which is valid I think, according to the spec (this is why I added this field on `HiddenField`, to be complete). It renders as an invisible and not submitted field. Not very useful (though if I can imagine use cases where this could be handy), but since you can do it in HTML I thought we should support it.



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] danwatford commented on pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
danwatford commented on PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#issuecomment-1271771742

   Tested as PASSED.
   
   Tested by changing form `GISetupForms.xml#PartyAcctgPreference` and set the disabled attribute on the `errorGlJournalId` field defined on line 376. Changes were observed in the browser at page https://localhost:8443/accounting/control/PartyAcctgPreference
   
   Added attribute to field:
   ```
   disabled="${partyAcctgPreference.refundPaymentMethodId == 'ABN_CHECKING'}"
   ```
   
   Then cycled through the values of Refund Payment Method ID on the form, saving after each change and observing whether the Error GL Journal ID drop down was disabled.
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#issuecomment-1271588389

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=548)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#issuecomment-1271186403

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=548)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#issuecomment-1265244272

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=548)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r989744094


##########
framework/widget/dtd/widget-form.xsd:
##########
@@ -857,7 +857,13 @@ under the License.
                     </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
-            <xs:attribute name="disabled" type="xs:boolean" default="false"/>
+            <xs:attribute type="xs:string" name="disabled">
+                <xs:annotation>
+                    <xs:documentation>
+                        Set a field as disabled : not mutable, not focusable, not submitted if in a form.
+                    </xs:documentation>

Review Comment:
   done



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] florianMo commented on a diff in pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
florianMo commented on code in PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#discussion_r990084738


##########
framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java:
##########
@@ -729,7 +729,7 @@ public String getConditionGroup() {
      * Gets disabled.*
      * @return the disabled
      */
-    public boolean getDisabled() {
+    public FlexibleStringExpander getDisabled() {

Review Comment:
   > A few changes requested around exposing disabled boolean state vs the specification of the disabled field attribute. These changes might have knock-on effects to callers which would also need clean up.
   
   Changes made @danwatford, so now we're passing a boolean to HTML macros (most notable adjustment).



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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #548: Improved: Use FlexibleStringExpander for disabled attribute on fields

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #548:
URL: https://github.com/apache/ofbiz-framework/pull/548#issuecomment-1271580695

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=548)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=548&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=548&metric=new_duplicated_lines_density&view=list)
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org