-- Seam 1.2.1 standard setup --
I needed to add onclick, onfocus and onblur events to my s:fileUpload tags but the attributes weren't showing up in the html. So I added them to UIFileUpload.java. Is this the correct way to do this?
Index: UIFileUpload.java
===================================================================
--- UIFileUpload.java (revision 5)
+++ UIFileUpload.java (working copy)
@@ -25,7 +25,10 @@
private String accept;
private String styleClass;
- private String style;
+ private String style;
+ private String onclick;
+ private String onfocus;
+ private String onblur;
@Override
public void decode(FacesContext context)
@@ -151,7 +154,22 @@
{
writer.writeAttribute(HTML.STYLE_ATTR, style, null);
}
-
+
+ if (onclick != null)
+ {
+ writer.writeAttribute(HTML.ONCLICK_ATTR, onclick, null);
+ }
+
+ if (onfocus != null)
+ {
+ writer.writeAttribute(HTML.ONFOCUS_ATTR, onfocus, null);
+ }
+
+ if (onblur != null)
+ {
+ writer.writeAttribute(HTML.ONBLUR_ATTR, onblur, null);
+ }
+
writer.endElement(HTML.INPUT_ELEM);
}
@@ -191,4 +209,34 @@
this.styleClass = styleClass;
}
+ public String getOnblur()
+ {
+ return onblur;
+ }
+
+ public void setOnblur(String onblur)
+ {
+ this.onblur = onblur;
+ }
+
+ public String getOnclick()
+ {
+ return onfocus;
+ }
+
+ public void setOnclick(String onclick)
+ {
+ this.onclick = onclick;
+ }
+
+ public String getOnfocus()
+ {
+ return onfocus;
+ }
+
+ public void setOnfocus(String onfocus)
+ {
+ this.onfocus = onfocus;
+ }
+
}