summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-03-05 09:20:37 (EST)
committerManik Kishore2012-06-19 07:10:48 (EDT)
commit3616568e9ec966e22ebf8e50eac3424f352558b1 (patch)
treeee592de6b4e82139c0591d403dbbc47d756b74c2
parenta61a31c709d03906af96e8ed7cdc05040ee5d0fb (diff)
downloadorg.eclipse.stardust.ui.common-3616568e9ec966e22ebf8e50eac3424f352558b1.zip
org.eclipse.stardust.ui.common-3616568e9ec966e22ebf8e50eac3424f352558b1.tar.gz
org.eclipse.stardust.ui.common-3616568e9ec966e22ebf8e50eac3424f352558b1.tar.bz2
Jira-ID: CRNT-24021
1)Added code to return different maxLength based on dataType in mapMaxLength() in FormGenerator.java 2)Changed style for .form-panel-number-input in stardust-ui-form-jsf.css by setting width=125px; 3)Bypasssed style for Double and Float in evaluateInputTextPreferences() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.common@54318 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/JsfFormGenerator.java2
-rw-r--r--stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/utils/IceFacesComponentUtils.java6
-rw-r--r--stardust-ui-form-jsf/src/main/resources/META-INF/webapp/public/css/stardust-ui-form-jsf.css2
-rw-r--r--stardust-ui-form/src/main/java/org/eclipse/stardust/ui/common/form/FormGenerator.java24
4 files changed, 28 insertions, 6 deletions
diff --git a/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/JsfFormGenerator.java b/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/JsfFormGenerator.java
index a18a8f9..6e8d89e 100644
--- a/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/JsfFormGenerator.java
+++ b/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/JsfFormGenerator.java
@@ -652,7 +652,7 @@ public class JsfFormGenerator extends FormGenerator
}
else
{
- if (path.isNumber())
+ if (path.isNumber() && ((path.getJavaClass() != Float.class) && (path.getJavaClass() != Double.class)))
{
inputText.setStyleClass("form-panel-number-input");
}
diff --git a/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/utils/IceFacesComponentUtils.java b/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/utils/IceFacesComponentUtils.java
index cba1b85..107a8f9 100644
--- a/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/utils/IceFacesComponentUtils.java
+++ b/stardust-ui-form-jsf/src/main/java/org/eclipse/stardust/ui/common/form/jsf/utils/IceFacesComponentUtils.java
@@ -223,8 +223,10 @@ public class IceFacesComponentUtils
HtmlInputText inputText = new HtmlInputText();
inputText.setId(JsfFormGenerator.PREFIX + "input-text-" + UUID.randomUUID());
inputText.setPartialSubmit(true);
- inputText.setMaxlength(maxLength);
-
+ if (maxLength > 0)
+ {
+ inputText.setMaxlength(maxLength);
+ }
addToParent(parent, inputText);
return inputText;
}
diff --git a/stardust-ui-form-jsf/src/main/resources/META-INF/webapp/public/css/stardust-ui-form-jsf.css b/stardust-ui-form-jsf/src/main/resources/META-INF/webapp/public/css/stardust-ui-form-jsf.css
index 9ae967d..37337fd 100644
--- a/stardust-ui-form-jsf/src/main/resources/META-INF/webapp/public/css/stardust-ui-form-jsf.css
+++ b/stardust-ui-form-jsf/src/main/resources/META-INF/webapp/public/css/stardust-ui-form-jsf.css
@@ -114,7 +114,7 @@
.form-panel-number-input
{
- width: 100px;
+ width: 125px;
border: 1px solid #aaaaaa;
text-align: right;
}
diff --git a/stardust-ui-form/src/main/java/org/eclipse/stardust/ui/common/form/FormGenerator.java b/stardust-ui-form/src/main/java/org/eclipse/stardust/ui/common/form/FormGenerator.java
index 51fc377..c3b774c 100644
--- a/stardust-ui-form/src/main/java/org/eclipse/stardust/ui/common/form/FormGenerator.java
+++ b/stardust-ui-form/src/main/java/org/eclipse/stardust/ui/common/form/FormGenerator.java
@@ -121,7 +121,7 @@ public abstract class FormGenerator
* @param type
* @return
*/
- public static int mapMaxLength(Class<?> type)
+ public static int mapMaxLength(Class< ? > type)
{
if (type == String.class)
{
@@ -129,12 +129,32 @@ public abstract class FormGenerator
}
else if (type == Integer.class)
{
- return 12;
+ return 11;
+ }
+ else if (type == Byte.class)
+ {
+ return 4;
+ }
+ else if (type == Short.class)
+ {
+ return 6;
+ }
+ else if (type == Long.class)
+ {
+ return 20;
+ }
+ else if (type == Float.class)
+ {
+ return 40;
}
else if (type == Character.class)
{
return 1;
}
+ else if (type == Double.class)
+ {
+ return 0;
+ }
else
{
return 30;