code: protected String buildSelectBox(
          String baseId,
          int level,
          List<CmsSelectWidgetOption> options,
          String selected,
          boolean hasError,
          boolean last) {
  
          StringBuffer result = new StringBuffer(16);
          String id = baseId + "cat" + level + "Id";
          String childId = baseId + "cat" + (level + 1) + "Id";
          result.append("<select class=\"xmlInput");
          if (hasError) {
              result.append(" xmlInputError");
          }
          result.append("\" name=\"");
          result.append(id);
          result.append("\" id=\"");
          result.append(id);
          result.append("\" onchange=\"");
          if (last) {
              result.append("setWidgetValue('" + baseId + "');");
          } else {
              String jsId = CmsStringUtil.substitute(baseId, ".", "");
              result.append("setChildListBox(this, getElemById('" + childId + "'), cat" + (level + 1) + jsId + ");");
          }
          result.append("\">");
  
          Iterator<CmsSelectWidgetOption> i = options.iterator();
          while (i.hasNext()) {
              CmsSelectWidgetOption option = i.next();
              // create the option
              result.append("<option value=\"");
              result.append(option.getValue());
              result.append("\"");
              if ((selected != null) && selected.equals(option.getValue())) {
                  result.append(" selected=\"selected\"");
              }
              result.append(">");
              result.append(option.getOption());
              result.append("</option>");
          }
          result.append("</select>");
          return result.toString();
      }
docs: Generates html code for the category selection.<p>
  
  @param baseId the widget id
  @param level the category deep level
  @param options the list of {@link CmsSelectWidgetOption} objects
  @param selected the selected option
  @param hasError if to display error message
  @param last if it is the last level
  
  @return html code