// Metodo para validar campos del formulario //
  public boolean validarForm() throws Exception {

    boolean valida = true;
    XulElement xulElement = null;
    if (tbxManual.getValue().trim().isEmpty()) {
      MensajesUtil.notificarError("El campo Manual es obligatorio", tbxManual);
      valida = false;
      if (xulElement == null) xulElement = tbxManual;
    }
    if (lbxTipo_manual.getSelectedItem().getValue().toString().trim().isEmpty()) {
      MensajesUtil.notificarError("El campo Tipo manual es obligatorio", lbxTipo_manual);
      valida = false;
      if (xulElement == null) xulElement = lbxTipo_manual;
    }
    if (lbxTipo_moneda.getSelectedItem().getValue().toString().trim().isEmpty()) {
      MensajesUtil.notificarError("El campo Tipo moneda es obligatorio", lbxTipo_moneda);
      valida = false;
      if (xulElement == null) xulElement = lbxTipo_moneda;
    }

    if (xulElement != null) {
      Clients.scrollIntoView(xulElement);
      xulElement.setFocus(true);
    }
    return valida;
  }
Exemplo n.º 2
0
 /**
  * Sets the mold.
  *
  * @param mold default , accordion and accordion-lite
  */
 public void setMold(String mold) {
   if (isVertical()) {
     if (mold.startsWith("accordion")) {
       throw new WrongValueException("Unsupported vertical orient in mold : " + mold);
     } else {
       super.setMold(mold);
     }
   } else {
     super.setMold(mold);
   }
 }
Exemplo n.º 3
0
 /**
  * Processes an AU request.
  *
  * <p>Default: in addition to what are handled by {@link XulElement#service}, it also handles
  * onOpen.
  *
  * @since 5.0.0
  */
 public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
   final String cmd = request.getCommand();
   if (cmd.equals(Events.ON_OPEN)) {
     OpenEvent evt = OpenEvent.getOpenEvent(request);
     setVisible(evt.isOpen());
     Events.postEvent(evt);
   } else if (cmd.equals(Events.ON_MAXIMIZE)) {
     MaximizeEvent evt = MaximizeEvent.getMaximizeEvent(request);
     setLeftDirectly(evt.getLeft());
     setTopDirectly(evt.getTop());
     setWidthDirectly(evt.getWidth());
     setHeightDirectly(evt.getHeight());
     _maximized = evt.isMaximized();
     if (_maximized) setVisibleDirectly(true);
     Events.postEvent(evt);
   } else if (cmd.equals(Events.ON_MINIMIZE)) {
     MinimizeEvent evt = MinimizeEvent.getMinimizeEvent(request);
     setLeftDirectly(evt.getLeft());
     setTopDirectly(evt.getTop());
     setWidthDirectly(evt.getWidth());
     setHeightDirectly(evt.getHeight());
     _minimized = evt.isMinimized();
     if (_minimized) {
       setVisibleDirectly(false);
       if (_mode == MODAL) leaveModal(OVERLAPPED);
     }
     Events.postEvent(evt);
   } else super.service(request, everError);
 }
Exemplo n.º 4
0
 protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
     throws java.io.IOException {
   super.renderProperties(renderer);
   if (_panelSpacing != null) render(renderer, "panelSpacing", _panelSpacing);
   if (!"horizontal".equals(_orient)) render(renderer, "orient", _orient);
   if (!_tabscroll) renderer.render("tabscroll", _tabscroll);
 }
Exemplo n.º 5
0
 // -- super --//
 public void setDraggable(String draggable) {
   if (_mode != EMBEDDED) {
     if (draggable != null && (draggable.length() > 0 && !"false".equals(draggable)))
       throw new UiException("Only embedded window could be draggable: " + this);
   }
   super.setDraggable(draggable);
 }
Exemplo n.º 6
0
  protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
      throws java.io.IOException {
    super.renderProperties(renderer);

    render(renderer, "spacing", _spacing);
    render(renderer, "orient", _orient);
    render(renderer, "bar", _bar);
  }
Exemplo n.º 7
0
 private boolean setVisible0(boolean visible) {
   if (!visible && _mode == MODAL) {
     // Hide first to avoid unpleasant effect
     super.setVisible(false);
     leaveModal(OVERLAPPED);
     return true;
   }
   return super.setVisible(visible);
 }
Exemplo n.º 8
0
 // -- Component --//
 public void beforeChildAdded(Component child, Component refChild) {
   if (child instanceof Caption) {
     if (_caption != null && _caption != child)
       throw new UiException("Only one caption is allowed: " + this);
   } else if (refChild instanceof Caption) {
     throw new UiException("caption must be the first child");
   }
   super.beforeChildAdded(child, refChild);
 }
Exemplo n.º 9
0
 public void onChildRemoved(Component child) {
   if (_tabs == child) {
     removeTabsListeners();
     _tabs = null;
     _seltab = null;
   } else if (_tabpanels == child) {
     _tabpanels = null;
   } else if (_toolbar == child) {
     _toolbar = null;
   }
   super.onChildRemoved(child);
 }
Exemplo n.º 10
0
  // super//
  protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException {
    super.renderProperties(renderer);

    int v = getMaxlength();
    if (v > 0) renderer.render("maxlength", v);
    render(renderer, "multiline", isMultiline());
    render(renderer, "pre", isPre());

    final String val = getValue();
    // allow deriving to override getValue()
    render(renderer, "value", val);
    org.zkoss.zul.impl.Utils.renderCrawlableText(val);
  }
Exemplo n.º 11
0
  public void setParent(Component parent) {
    final Component oldp = getParent();
    if (oldp == parent) return; // nothing changed

    final Tree oldtree = oldp != null ? getTree() : null;

    super.setParent(parent);

    // maintain the selected status
    if (oldtree != null) oldtree.onTreechildrenRemoved(this);
    if (parent != null) {
      final Tree tree = getTree();
      if (tree != null) tree.onTreechildrenAdded(this);
    }
  }
Exemplo n.º 12
0
 // -- Component --//
 public void beforeChildAdded(Component child, Component refChild) {
   if (child instanceof Toolbar) {
     if (_toolbar != null && _toolbar != child)
       throw new UiException("Only one Toolbar is allowed: " + this);
   } else if (child instanceof Tabs) {
     if (_tabs != null && _tabs != child)
       throw new UiException("Only one tabs is allowed: " + this);
   } else if (child instanceof Tabpanels) {
     if (_tabpanels != null && _tabpanels != child)
       throw new UiException("Only one tabpanels is allowed: " + this);
   } else {
     throw new UiException("Unsupported child for tabbox: " + child);
   }
   super.beforeChildAdded(child, refChild);
 }
Exemplo n.º 13
0
  // super
  protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
      throws java.io.IOException {
    super.renderProperties(renderer);

    render(renderer, "title", _title);
    render(renderer, "maximized", _maximized);
    render(renderer, "maximizable", _maximizable);
    render(renderer, "minimized", _minimized);
    render(renderer, "minimizable", _minimizable);
    render(renderer, "closable", _closable);
    render(renderer, "sizable", _sizable);
    render(renderer, "position", _pos);
    render(renderer, "contentStyle", _cntStyle);
    render(renderer, "contentSclass", _cntSclass);
    if (_minheight != 100) renderer.render("minheight", _minheight);
    if (_minwidth != 200) renderer.render("minwidth", _minwidth);
    if (!"none".equals(_border)) renderer.render("border", _border);
    if (!isShadow()) renderer.render("shadow", false);
    if (_mode != EMBEDDED) renderer.render("mode", modeToString(_mode));
    // render mode as the last property
  }
Exemplo n.º 14
0
 public void renderProperties(ContentRenderer renderer) throws IOException{
     super.renderProperties(renderer);
     render(renderer, "_resourceName", getResourceName());
 }
Exemplo n.º 15
0
 public void beforeChildAdded(Component child, Component refChild) {
   if (!(child instanceof Treeitem))
     throw new UiException("Unsupported child for treechildren: " + child);
   super.beforeChildAdded(child, refChild);
 }
Exemplo n.º 16
0
 // -- Component --//
 public void beforeParentChanged(Component parent) {
   if (parent != null && !(parent instanceof Tree) && !(parent instanceof Treeitem))
     throw new UiException("Wrong parent: " + parent);
   super.beforeParentChanged(parent);
 }
Exemplo n.º 17
0
 public void onChildRemoved(Component child) {
   super.onChildRemoved(child);
   addVisibleItemCount(-((Treeitem) child).getVisibleItemCount());
 }
Exemplo n.º 18
0
 public void beforeChildAdded(Component child, Component refChild) {
   if (!(child instanceof Listfooter))
     throw new UiException("Unsupported child for listfoot: " + child);
   super.beforeChildAdded(child, refChild);
 }
Exemplo n.º 19
0
Arquivo: Treerow.java Projeto: dije/zk
 public void smartUpdate(String attr, Object value) {
   super.smartUpdate(attr, value);
 }
Exemplo n.º 20
0
 public void onChildRemoved(Component child) {
   if (child instanceof Caption) _caption = null;
   super.onChildRemoved(child);
 }