예제 #1
0
 /** Return a button that invokes javascript when clicked. */
 Input jsButton(String label, String js) {
   Input btn = new Input("button", null);
   btn.attribute("value", label);
   setTabOrder(btn);
   btn.attribute("onClick", js);
   return btn;
 }
예제 #2
0
 /**
  * Return a button that invokes the javascript submit routine with the specified action, first
  * storing the value in the specified form prop.
  */
 protected Element submitButton(String label, String action, String prop, String value) {
   StringBuilder sb = new StringBuilder(40);
   sb.append("lockssButton(this, '");
   sb.append(action);
   sb.append("'");
   if (prop != null && value != null) {
     sb.append(", '");
     sb.append(prop);
     sb.append("', '");
     sb.append(value);
     sb.append("'");
   }
   sb.append(")");
   Input btn = jsButton(label, sb.toString());
   btn.attribute("id", "lsb." + (++submitButtonNumber));
   return btn;
 }