@Override
public void displayEdit(StringBuffer buffer, String name, String prefix,
BaseCollection object, XWikiContext context)
{
input input = new input();
BaseProperty prop = (BaseProperty) object.safeget(name);
if (prop != null) {
input.setValue(prop.toFormString());
}
input.setType("text");
input.setName(prefix + name);
input.setID(prefix + name);
input.setSize(getSize());
input.setDisabled(isDisabled());
if (isPicker()) {
input.setClass("suggested");
String path = "";
XWiki xwiki = context.getWiki();
path = xwiki.getURL("Main.WebHome", "view", context);
String classname = this.getObject().getName();
String fieldname = this.getName();
String secondCol = "-", firstCol = "-";
String script =
"\"" + path + "?xpage=suggest&classname=" + classname + "&fieldname=" + fieldname
+ "&firCol=" + firstCol + "&secCol=" + secondCol + "&\"";
String varname = "\"input\"";
input.setOnFocus("new ajaxSuggest(this, {script:" + script + ", varname:" + varname + "} )");
}
buffer.append(input.toString());
}