Search in sources :

Example 6 with HtmlBasedComponent

use of org.zkoss.zk.ui.HtmlBasedComponent in project adempiere by adempiere.

the class WPAttributeDialog method cmd_newEdit.

//	cmd_select
/**
	 * 	Instance New/Edit
	 */
private void cmd_newEdit() {
    boolean rw = cbNewEdit.isChecked();
    log.config("R/W=" + rw + " " + m_masi);
    //
    fieldLotString.setReadonly(!(rw && m_masi.getM_Lot_ID() == 0));
    if (fieldLot != null)
        fieldLot.setEnabled(rw);
    bLot.setEnabled(rw);
    fieldSerNo.setReadonly(!rw);
    bSerNo.setEnabled(rw);
    fieldGuaranteeDate.setReadonly(!rw);
    //
    for (int i = 0; i < m_editors.size(); i++) {
        HtmlBasedComponent editor = m_editors.get(i);
        if (editor instanceof InputElement)
            ((InputElement) editor).setReadonly(!rw);
        else if (editor instanceof Listbox)
            ((Listbox) editor).setEnabled(rw);
        else if (editor instanceof NumberBox)
            ((NumberBox) editor).setEnabled(rw);
    }
}
Also used : InputElement(org.zkoss.zul.impl.InputElement) NumberBox(org.adempiere.webui.component.NumberBox) HtmlBasedComponent(org.zkoss.zk.ui.HtmlBasedComponent) Listbox(org.adempiere.webui.component.Listbox)

Aggregations

HtmlBasedComponent (org.zkoss.zk.ui.HtmlBasedComponent)6 Label (org.adempiere.webui.component.Label)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 ValueChangeEvent (org.adempiere.exceptions.ValueChangeEvent)1 Button (org.adempiere.webui.component.Button)1 Checkbox (org.adempiere.webui.component.Checkbox)1 Combobox (org.adempiere.webui.component.Combobox)1 Grid (org.adempiere.webui.component.Grid)1 Listbox (org.adempiere.webui.component.Listbox)1 NumberBox (org.adempiere.webui.component.NumberBox)1 Event (org.zkoss.zk.ui.event.Event)1 EventListener (org.zkoss.zk.ui.event.EventListener)1 Decimalbox (org.zkoss.zul.Decimalbox)1 Hbox (org.zkoss.zul.Hbox)1 Image (org.zkoss.zul.Image)1 Menuitem (org.zkoss.zul.Menuitem)1 Radio (org.zkoss.zul.Radio)1 Radiogroup (org.zkoss.zul.Radiogroup)1 InputElement (org.zkoss.zul.impl.InputElement)1