empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1378675 - in /empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2: controls/ utils/
Date Wed, 29 Aug 2012 18:36:11 GMT
Author: doebele
Date: Wed Aug 29 18:36:10 2012
New Revision: 1378675

URL: http://svn.apache.org/viewvc?rev=1378675&view=rev
Log:
EMPIREDB-157 
JSF2 use readOnly instead of disabled for InputControls

Modified:
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/CheckboxInputControl.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextAreaInputControl.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/CheckboxInputControl.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/CheckboxInputControl.java?rev=1378675&r1=1378674&r2=1378675&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/CheckboxInputControl.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/CheckboxInputControl.java
Wed Aug 29 18:36:10 2012
@@ -58,6 +58,10 @@ public class CheckboxInputControl extend
                 throw new InternalException(e2);
             }
             copyAttributes(parent, ii, input);
+            // disabled
+            Object dis = ii.getAttribute("disabled");
+            if (dis!=null)
+                input.setDisabled(ObjectUtils.getBoolean(dis));
             // add
             compList.add(input);
         }
@@ -71,7 +75,7 @@ public class CheckboxInputControl extend
         }
         
         // Set Value
-        input.setDisabled(ii.isDisabled());
+        input.setReadonly(ii.isDisabled());
         setInputValue(input, ii);
     }
     

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java?rev=1378675&r1=1378674&r2=1378675&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
Wed Aug 29 18:36:10 2012
@@ -25,6 +25,7 @@ import javax.faces.component.UISelectIte
 import javax.faces.component.html.HtmlSelectOneMenu;
 import javax.faces.context.FacesContext;
 
+import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.OptionEntry;
 import org.apache.empire.commons.Options;
 import org.apache.empire.data.Column;
@@ -78,8 +79,13 @@ public class SelectInputControl extends 
             } catch (IllegalAccessException e2) {
                 throw new InternalException(e2);
             }
+            // copy Attributes
             copyAttributes(parent, ii, input);
-    
+            // disabled
+            Object dis = ii.getAttribute("disabled");
+            if (dis!=null)
+                input.setDisabled(ObjectUtils.getBoolean(dis));
+            // Options
             Options options = ii.getOptions();
             if (ii.isRequired()==false)
             {   // Empty entry
@@ -106,7 +112,7 @@ public class SelectInputControl extends 
         }
         
         // Set Value
-        input.setDisabled(ii.isDisabled());
+        input.setReadonly(ii.isDisabled());
         setInputValue(input, ii);
     }
     

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextAreaInputControl.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextAreaInputControl.java?rev=1378675&r1=1378674&r2=1378675&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextAreaInputControl.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextAreaInputControl.java
Wed Aug 29 18:36:10 2012
@@ -24,6 +24,7 @@ import javax.faces.component.UIComponent
 import javax.faces.component.html.HtmlInputTextarea;
 import javax.faces.context.FacesContext;
 
+import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.exceptions.InternalException;
 import org.apache.empire.exceptions.UnexpectedReturnValueException;
 
@@ -64,16 +65,20 @@ public class TextAreaInputControl extend
             } catch (IllegalAccessException e2) {
                 throw new InternalException(e2);
             }
+            // once
             copyAttributes(parent, ii, input);
-            
+            // disabled
+            Object dis = ii.getAttribute("disabled");
+            if (dis!=null)
+                input.setDisabled(ObjectUtils.getBoolean(dis));
+            // cols
             int cols = getFormatInteger(ii, FORMAT_COLS, FORMAT_COLS_ATTRIBUTE);
             if (cols>0)
                 input.setCols(cols);
-    
+            // rows
             int rows = getFormatInteger(ii, FORMAT_ROWS, FORMAT_ROWS_ATTRIBUTE);
             if (rows>0)
                 input.setRows(rows);
-
             // add
             compList.add(input);
         }
@@ -87,7 +92,7 @@ public class TextAreaInputControl extend
         }
         
         // Set Value
-        input.setDisabled(ii.isDisabled());
+        input.setReadonly(ii.isDisabled());
         setInputValue(input, ii);
         
     }

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java?rev=1378675&r1=1378674&r2=1378675&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
Wed Aug 29 18:36:10 2012
@@ -87,6 +87,10 @@ public class TextInputControl extends In
             }
             // once
             copyAttributes(parent, ii, input);
+            // disabled
+            Object dis = ii.getAttribute("disabled");
+            if (dis!=null)
+                input.setDisabled(ObjectUtils.getBoolean(dis));
             // language
             input.setLang(ii.getLocale().getLanguage());
             // maxlength
@@ -119,7 +123,7 @@ public class TextInputControl extends In
         }
             
         // Set Value
-        input.setDisabled(ii.isDisabled()); //  || ii.getColumn().isAutoGenerated()
+        input.setReadonly(ii.isDisabled()); //  || ii.getColumn().isAutoGenerated()
         setInputValue(input, ii);
         
     }

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java?rev=1378675&r1=1378674&r2=1378675&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
Wed Aug 29 18:36:10 2012
@@ -302,7 +302,10 @@ public class TagEncodingHelper implement
         @Override
         public String getStyleClass(String addlStyle)
         {
-            return getTagStyleClass(addlStyle);
+            String style = getTagStyleClass(addlStyle);
+            if (isReadOnly())
+                style += " eInpDis";
+            return style; 
         }
 
         @Override



Mime
View raw message