docs: protected String buildQuery(Properties parms, RequestType type) {
      if (parms.isEmpty())
        type = RequestType.query;
      RString result = new RString(_queryHtml);
      result.replace("REQ_NAME", this.getClass().getSimpleName());
      StringBuilder query = new StringBuilder();
      query.append("<form onsubmit='return false;'>");
      RString script = new RString(_queryJs);
      script.replace("REQUEST_NAME", getClass().getSimpleName());
      for (Argument arg: _arguments) {
        try {
          arg.check(RequestQueries.this, parms.getProperty(arg._name,""));
          queryArgumentValueSet(arg, parms);
        } catch( IllegalArgumentException e ) {
          // in query mode only display error for arguments present
          if ((type != RequestType.query) || !parms.getProperty(arg._name,"").isEmpty())
            query.append("<div class='alert alert-error'>"+e.getMessage()+"</div>");
        }
        if (arg._hideInQuery)
          continue;
        if (!arg.disabled()) {
          RString x = script.restartGroup("REQUEST_ELEMENT");
          x.replace("ELEMENT_NAME",arg._name);
          // If some Argument has prerequisites, and those pre-reqs changed on
          // this very page load then we do not assign the arg here: the values
          // passed will be something valid from the PRIOR page - based on the
          // old pre-req - and won't be correct.  Not assigning them here means
          // we'll act "as if" the field was never filled in.
          if( arg._prerequisites != null ) {
            StringBuilder sb = new StringBuilder("if( ");
            ArrayList<RequestArguments.Argument> preqs = arg._prerequisites;
            for( RequestArguments.Argument dep : preqs )
              sb.append("specArg!=='").append(dep._name).append("' && ");
            sb.append("true ) ");
            x.replace("ELEMENT_PREQ",sb);
          }
          x.append();
          x = script.restartGroup("ELEMENT_VALUE");
          x.replace("ELEMENT_NAME",arg._name);
          x.replace("BODY","function query_value_"+arg._name+"() { "+arg.jsValue()+"} ");
          x.append();
        }
        if (arg.refreshOnChange()) {
          RString x = script.restartGroup("ELEMENT_ONCHANGE");
          x.replace("BODY",arg.jsRefresh("query_refresh"));
          x.append();
        }
        RString x = script.restartGroup("ELEMENT_ADDONS");
        x.replace("BODY", arg.jsAddons());
        x.append();
      }
      for(Argument arg:_arguments){
        if (arg._hideInQuery)
          continue;
        query.append(arg.query());
      }
      query.append("</form>");
      result.replace("QUERY",query.toString());
      result.replace("SCRIPT",script.toString());
      return result.toString();
    }
  
  }