Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.WrongValueException


      while (v != 0 && --divscale >= 0)
        v /= 10;
      return new Integer(v);
    } catch (NumberFormatException ex) {
      throw showCustomError(
        new WrongValueException(this, MZul.NUMBER_REQUIRED, value));
    }
  }
View Full Code Here


   * for details.
   */
  public void setDynamicProperty(String name, Object value)
  throws WrongValueException {
    if (name == null)
      throw new WrongValueException("name is required");
    if (!hasDynamicProperty(name))
      throw new WrongValueException("Attribute not allowed: "+name+"\nSpecify the ZK namespace if you want to use special ZK attributes");

    String sval = Objects.toString(value);
    if ("style".equals(name)) {
      sval = filterStyle(sval);
      setDynaProp(name, sval);
View Full Code Here

   * @since 3.0.7
   */
  public void setPagingPosition(String pagingPosition) {
    if (pagingPosition == null || (!pagingPosition.equals("top") &&
      !pagingPosition.equals("bottom") && !pagingPosition.equals("both")))
      throw new WrongValueException("Unsupported position : "+pagingPosition);
    if(!Objects.equals(_pagingPosition, pagingPosition)){
      _pagingPosition = pagingPosition;
      smartUpdate("pagingPosition", pagingPosition);
    }
  }
View Full Code Here

   * <p>Note: if both {@link #setHeight} is specified with non-empty,
   * {@link #setRows} is ignored
   */
  public void setRows(int rows) throws WrongValueException {
    if (rows < 0)
      throw new WrongValueException("Illegal rows: "+rows);

    if (_rows != rows) {
      _rows = rows;
      smartUpdate("rows", _rows);
    }
View Full Code Here

   * Currently, only "single" is supported.
   */
  public void setSeltype(String seltype) throws WrongValueException {
    if ("single".equals(seltype)) setMultiple(false);
    else if ("multiple".equals(seltype)) setMultiple(true);
    else throw new WrongValueException("Unknown seltype: "+seltype);
  }
View Full Code Here

   * Note: if both {@link #setHeight} is specified with non-empty,
   * {@link #setRows} is ignored
   */
  public void setRows(int rows) throws WrongValueException {
    if (rows < 0)
      throw new WrongValueException("Illegal rows: " + rows);

    if (_rows != rows) {
      _rows = rows;
      smartUpdate("rows", _rows);
    }
View Full Code Here

    if ("single".equals(seltype))
      setMultiple(false);
    else if ("multiple".equals(seltype))
      setMultiple(true);
    else
      throw new WrongValueException("Unknown seltype: " + seltype);
  }
View Full Code Here

   *
   * @since 3.6.0
   */
  public void setSelectedItems(Set listItems) {
    if (!isMultiple())
      throw new WrongValueException(
          "Listbox must allow multiple selections.");
    for (Iterator it = listItems.iterator(); it.hasNext();) {
      addItemToSelection((Listitem) it.next());
    }
  }
View Full Code Here

   * @param align must be "start" or "center" or "end".
   * @since 3.0.0
   */
  public void setAlign(String align) throws WrongValueException {
    if (!"start".equals(align) && !"center".equals(align) && !"end".equals(align))
      throw new WrongValueException(align);

    if (!Objects.equals(_align, align)) {
      _align = align;
      smartUpdate("align", _align);
    }
View Full Code Here

  /** Sets the number of columns to span this header.
   * <p>It is the same as the colspan attribute of HTML TD tag.
   */
  public void setColspan(int colspan) throws WrongValueException {
    if (colspan <= 0)
      throw new WrongValueException("Positive only");
    if (_colspan != colspan) {
      _colspan = colspan;
      smartUpdate("colspan", _colspan);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.WrongValueException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.