// 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;
  }
예제 #2
0
파일: Tabbox.java 프로젝트: KevinLong/zk
 /**
  * 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);
   }
 }
예제 #3
0
파일: Window.java 프로젝트: tmillsclare/zk
 /**
  * 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);
 }
예제 #4
0
파일: Tabbox.java 프로젝트: KevinLong/zk
 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);
 }
예제 #5
0
파일: Window.java 프로젝트: tmillsclare/zk
 // -- 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);
 }
예제 #6
0
파일: Separator.java 프로젝트: zkoss/zk
  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);
  }
예제 #7
0
파일: Window.java 프로젝트: tmillsclare/zk
 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);
 }
예제 #8
0
파일: Window.java 프로젝트: tmillsclare/zk
 // -- 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);
 }
예제 #9
0
파일: Tabbox.java 프로젝트: KevinLong/zk
 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);
 }
예제 #10
0
파일: Label.java 프로젝트: tmillsclare/zk
  // 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);
  }
예제 #11
0
파일: Treechildren.java 프로젝트: dije/zk
  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);
    }
  }
예제 #12
0
파일: Tabbox.java 프로젝트: KevinLong/zk
 // -- 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);
 }
예제 #13
0
파일: Window.java 프로젝트: tmillsclare/zk
  // 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
  }
예제 #14
0
 public void renderProperties(ContentRenderer renderer) throws IOException{
     super.renderProperties(renderer);
     render(renderer, "_resourceName", getResourceName());
 }
예제 #15
0
파일: Treechildren.java 프로젝트: dije/zk
 public void beforeChildAdded(Component child, Component refChild) {
   if (!(child instanceof Treeitem))
     throw new UiException("Unsupported child for treechildren: " + child);
   super.beforeChildAdded(child, refChild);
 }
예제 #16
0
파일: Treechildren.java 프로젝트: dije/zk
 // -- Component --//
 public void beforeParentChanged(Component parent) {
   if (parent != null && !(parent instanceof Tree) && !(parent instanceof Treeitem))
     throw new UiException("Wrong parent: " + parent);
   super.beforeParentChanged(parent);
 }
예제 #17
0
파일: Treechildren.java 프로젝트: dije/zk
 public void onChildRemoved(Component child) {
   super.onChildRemoved(child);
   addVisibleItemCount(-((Treeitem) child).getVisibleItemCount());
 }
예제 #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);
 }
예제 #19
0
파일: Treerow.java 프로젝트: dije/zk
 public void smartUpdate(String attr, Object value) {
   super.smartUpdate(attr, value);
 }
예제 #20
0
파일: Window.java 프로젝트: tmillsclare/zk
 public void onChildRemoved(Component child) {
   if (child instanceof Caption) _caption = null;
   super.onChildRemoved(child);
 }