+(defattribute base-attribute ()
+ ()
+ (:in-layer editor)
+ (:default-properties
+ :callback nil
+ :default-value nil
+ :default-value-predicate #'null
+ :dom-id (js:gen-js-name-string :prefix "_ucw_")
+ :input-size nil))
+
+(define-layered-function display-value (attribute value)
+ (:method (attribute value)
+ (if (funcall (default-value-predicate attribute) value)
+ (default-value attribute)
+ value)))
+
+(defdisplay
+ :in-layer editor ((field base-attribute) object)
+ (LET ((value (attribute-value (object field) field)))
+ (<:input
+ :NAME
+ (callback field)
+ :VALUE (escape-as-html (strcat (display-value field value)))
+ :TYPE
+ "text"
+ :ID
+ (DOM-ID FIELD)
+ :SIZE
+ (INPUT-SIZE FIELD))))