// 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; }
/** * 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); } }
/** * 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); }
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); }
// -- 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); }
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); }
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); }
// -- 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); }
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); }
// 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); }
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); } }
// -- 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); }
// 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 }
public void renderProperties(ContentRenderer renderer) throws IOException{ super.renderProperties(renderer); render(renderer, "_resourceName", getResourceName()); }
public void beforeChildAdded(Component child, Component refChild) { if (!(child instanceof Treeitem)) throw new UiException("Unsupported child for treechildren: " + child); super.beforeChildAdded(child, refChild); }
// -- Component --// public void beforeParentChanged(Component parent) { if (parent != null && !(parent instanceof Tree) && !(parent instanceof Treeitem)) throw new UiException("Wrong parent: " + parent); super.beforeParentChanged(parent); }
public void onChildRemoved(Component child) { super.onChildRemoved(child); addVisibleItemCount(-((Treeitem) child).getVisibleItemCount()); }
public void beforeChildAdded(Component child, Component refChild) { if (!(child instanceof Listfooter)) throw new UiException("Unsupported child for listfoot: " + child); super.beforeChildAdded(child, refChild); }
public void smartUpdate(String attr, Object value) { super.smartUpdate(attr, value); }
public void onChildRemoved(Component child) { if (child instanceof Caption) _caption = null; super.onChildRemoved(child); }