Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.WrongValueException


   * Unlike XUL, "timed" is redudant because it is enabled as long as
   * onChanging is added.
   */
  public void setType(String type) throws WrongValueException {
    if (!TEXT.equals(type) && !"password".equals(type))
      throw new WrongValueException("Illegal type: "+type);

    if (!type.equals(_auxinf != null ? _auxinf.type: TEXT)) {
      initAuxInfo().type = type;
      smartUpdate("type", getType());
    }
View Full Code Here


  }
  /** Sets the rows.
   */
  public void setRows(int rows) throws WrongValueException {
    if (rows <= 0)
      throw new WrongValueException("Illegal rows: "+rows);

    if ((_auxinf != null ? _auxinf.rows: 1) != rows) {
      initAuxInfo().rows = rows;
      if (rows > 1)
        setMultiline(true); //auto-enable
View Full Code Here

  public void setCollapse(String collapse) throws WrongValueException {
    if (collapse == null || collapse.length() == 0)
      collapse = "none";
    else if (!"none".equals(collapse) && !"before".equals(collapse)
    && !"after".equals(collapse))
      throw new WrongValueException("Unknown collpase: "+collapse);

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

   * @param value the value; If null, it is considered as empty.
   */
  public void setText(String value) throws WrongValueException {
    if (_auxinf != null && _auxinf.maxlength > 0 && value != null && value.length() > _auxinf.maxlength)
      throw showCustomError(
        new WrongValueException(this, MZul.STRING_TOO_LONG, new Integer(_auxinf.maxlength)));

    final Object val = coerceFromString(value);
    final boolean same = Objects.equals(_value, val);
    boolean errFound = false;
    if (!same || !_valided || (_auxinf != null && _auxinf.errmsg != null)) { //note: the first time (!_valided) must always validate
View Full Code Here

  }
  /** Sets the cols.
   */
  public void setCols(int cols) throws WrongValueException {
    if (cols <= 0)
      throw new WrongValueException("Illegal cols: "+cols);

    if (_cols != cols) {
      _cols = cols;
      smartUpdate("cols", _cols);
    }
View Full Code Here

   * <p>Derives rarely need to access this method if they use only
   * {@link #getText} and {@link #getTargetValue}.
   */
  protected void checkUserError() throws WrongValueException {
    if (_auxinf != null && _auxinf.errmsg != null)
      throw showCustomError(new WrongValueException(this, _auxinf.errmsg));
        //Note: we still throw exception to abort the exec flow
        //It's client's job NOT to show the error box!
        //(client checks z.srvald to decide whether to open error box)

    if (!_valided && _auxinf != null && _auxinf.constr != null)
View Full Code Here

   * @since 3.5.0
   */
  public void setAlign(String align) {
    if (align == null) align = "start";
    if (!"start".equals(align) && !"center".equals(align) && !"end".equals(align))
      throw new WrongValueException("align cannot be "+align);
    if (!Objects.equals(_align, align)) {
      _align = align;
      smartUpdate("align", _align);
    }
  }
View Full Code Here

  /** Sets the orient.
   * @param orient either "horizontal" or "vertical".
   */
  public void setOrient(String orient) throws WrongValueException {
    if (!"horizontal".equals(orient) && !"vertical".equals(orient))
      throw new WrongValueException("orient cannot be " + orient);

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

  /** Sets the number of columns to span.
   * <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

  /** Sets the number of rows to span.
   * <p>It is the same as the rowspan attribute of HTML TD tag.
   */
  public void setRowspan(int rowspan) throws WrongValueException {
    if (rowspan <= 0)
      throw new WrongValueException("Positive only");
    if (_rowspan != rowspan) {
      _rowspan = rowspan;
      smartUpdate("rowspan", _rowspan);
    }
  }
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.