Search in sources :

Example 1 with InputElement

use of org.zkoss.zul.impl.InputElement 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

Listbox (org.adempiere.webui.component.Listbox)1 NumberBox (org.adempiere.webui.component.NumberBox)1 HtmlBasedComponent (org.zkoss.zk.ui.HtmlBasedComponent)1 InputElement (org.zkoss.zul.impl.InputElement)1