* @return Returns the a pice of HTML containing the variable and all
* nessecary javascripts
*/
@Override
public String createHTML(ElementParameter elemParam) {
LanguageHandler lang = LanguageHandler.getInstance();
String langID = elemParam.getLangId();
StringBuffer out = new StringBuffer();
// out.append("<span onmouseover=\"\">");
if(getTextlocation() != null){
if("left".equals(getTextlocation().toLowerCase())){
out.append("<label for=\"");
out.append(getName());
out.append("_CHECK\">");
out.append(lang.getTranslation(langID, getDescriptionID()));
out.append("</label>");
}
}
out.append("<input ");
if (!"".equals(getStylesheet())) {
out.append(" class=\"" + getStylesheet() + "\" ");
}
out.append("id=\"" + getName() + "_CHECK\" ");
out.append("type=\"checkbox\" ");
if (null != elemParam.getFetch()
&& null != elemParam.getFetch().getValueAsString(this.name)
&& "1".equals(elemParam.getFetch().getValueAsString(this.name))) {
out.append("value=\"1\" ");
}else {
out.append("value=\"0\" ");
}
//scripts
for(ScriptBean vsBean : scripts.values()) {
out.append(vsBean.getScriptname()+"=\"" + vsBean.getScriptvalue() + "\" ");
}
if (null != elemParam.getFetch().getValueAsString(this.name)
&& "1".equals(elemParam.getFetch().getValueAsString(this.name))) {
out.append("checked ");
}
out.append("></input>");
if (getTextlocation() != null) {
if ("right".equals(getTextlocation().toLowerCase())) {
out.append("<label for=\"");
out.append(getName());
out.append("_CHECK\">");
out.append(lang.getTranslation(langID, getDescriptionID()));
out.append("</label>");
}
}
if (mandatory) {
out.append("*");