Author: haint
Date: 2011-10-31 04:42:14 -0400 (Mon, 31 Oct 2011)
New Revision: 7914
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
Log:
GTNPORTAL-2243 cannot set editable and orther HTML attributes to UIFormDateTimeInput
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java 2011-10-31
04:56:12 UTC (rev 7913)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java 2011-10-31
08:42:14 UTC (rev 7914)
@@ -241,6 +241,15 @@
w.write(" value=\"");
w.write(value);
w.write('\"');
- w.write(" onclick='event.cancelBubble = true'
onkeydown='eXo.webui.UICalendar.onTabOut(event)'/>");
+ w.write(" onclick='event.cancelBubble = true'
onkeydown='eXo.webui.UICalendar.onTabOut(event)'");
+ if(!isEditable())
+ {
+ w.write(" readonly ");
+ }
+ if(hasHTMLAttribute())
+ {
+ renderHTMLAttribute(w);
+ }
+ w.write("/>");
}
}
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2011-10-31
04:56:12 UTC (rev 7913)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2011-10-31
08:42:14 UTC (rev 7914)
@@ -266,6 +266,15 @@
attribute.put(name, value);
}
+ public boolean hasHTMLAttribute()
+ {
+ if(attribute == null)
+ {
+ return false;
+ }
+ return attribute.size() > 0 ;
+ }
+
protected void renderHTMLAttribute(Writer w) throws IOException
{
if (attribute != null)
Show replies by date