Class TristateField

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Box
org.zkoss.zul.Hbox
com.saperion.ngc.iform.tristate.Tristate
com.saperion.ngc.iform.field.TristateField
All Implemented Interfaces:
EventChild, IntelligentField, Localized, Identifiable, Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl

public class TristateField extends Tristate implements IntelligentField, Identifiable
A field in a form for boolean values that offers three states: checked, unchecked, no value.
See Also:
  • Constructor Details

    • TristateField

      public TristateField(com.saperion.ngc.iform.xml.EditFieldType type, com.saperion.ngc.iform.xml.PosType panePos)
      Constructor.
      Parameters:
      type - Type
      panePos - Pane position
    • TristateField

      public TristateField()
      Constructor.
    • TristateField

      public TristateField(String label)
      Constructor.
      Parameters:
      label - Label
  • Method Details

    • onOK

      public void onOK(org.zkoss.zk.ui.event.Event event)
      On OK event handler.
      Parameters:
      event - Event
    • onPageAttached

      public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)
      Specified by:
      onPageAttached in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      onPageAttached in class org.zkoss.zk.ui.AbstractComponent
      See Also:
      • AbstractComponent.onPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)
    • onPageDetached

      public void onPageDetached(org.zkoss.zk.ui.Page page)
      Specified by:
      onPageDetached in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      onPageDetached in class org.zkoss.zk.ui.AbstractComponent
      See Also:
      • AbstractComponent.onPageDetached(org.zkoss.zk.ui.Page)
    • onIndexChange

      public void onIndexChange(org.zkoss.zk.ui.event.Event event)
      Event handler for index changes.
      Specified by:
      onIndexChange in interface IntelligentField
      Parameters:
      event - Event
      See Also:
    • onVariablesAvailable

      public void onVariablesAvailable(org.zkoss.zk.ui.event.Event event)
      Event handler for variablesAvailableEvent. The event-object sent does not contain data. To retrieve variables, use IntelligentFormView.getIndexMaskDocument().
      Specified by:
      onVariablesAvailable in interface IntelligentField
      Parameters:
      event - Event
      See Also:
    • onCancelEdit

      public void onCancelEdit(org.zkoss.zk.ui.event.Event event)
      Event handler for cancel edit event.
      Specified by:
      onCancelEdit in interface IntelligentField
      Parameters:
      event - event
      See Also:
    • setValue

      public void setValue(com.saperion.intf.SaPropertyValue value)
      Sets the value of this field.
      Specified by:
      setValue in interface IntelligentField
      Parameters:
      value - value
      See Also:
    • getPropertyValue

      public com.saperion.intf.SaPropertyValue getPropertyValue()
      Description copied from interface: IntelligentField
      Returns the current value of the field as SaPropertyValue.
      Specified by:
      getPropertyValue in interface IntelligentField
      Returns:
      the field's current value
    • setValueImplicitly

      public void setValueImplicitly(com.saperion.intf.SaPropertyValue val)
      Sets the value of this field and sets the changed-property of this field to true.
      Specified by:
      setValueImplicitly in interface IntelligentField
      Parameters:
      val - value
      See Also:
    • setValueImplicitly

      public void setValueImplicitly(com.saperion.intf.SaPropertyValue value, boolean fireChangedEvent)
      Sets the value of this field and sets the changed-property of this field to true.
      Specified by:
      setValueImplicitly in interface IntelligentField
      Parameters:
      value - value
      fireChangedEvent - if true, a Events.ON_CHANGE event will be fired after the value was set
      See Also:
    • onIndexClear

      public void onIndexClear(org.zkoss.zk.ui.event.Event event)
      Event handler for index clear.
      Specified by:
      onIndexClear in interface IntelligentField
      Parameters:
      event - Event
      See Also:
    • isChanged

      public boolean isChanged()
      Returns true if the value of this field was changed.
      Specified by:
      isChanged in interface IntelligentField
      Returns:
      Value is changed.
      See Also:
    • setEventOnOk

      public void setEventOnOk(ButtonInfo.EventType type)
      Starts event handling on enter key.
      Specified by:
      setEventOnOk in interface IntelligentField
      Parameters:
      type - Event type
      See Also:
    • doChangeValue

      public void doChangeValue(org.zkoss.zk.ui.event.Event event)
      Specified by:
      doChangeValue in interface IntelligentField
      Parameters:
      event - Event
      See Also:
    • getColorError

      public long getColorError()
      Returns:
      Value
      See Also:
      • EditFieldType.getColorError()
    • getColorOk

      public long getColorOk()
      Returns:
      Value
      See Also:
      • EditFieldType.getColorOk()
    • getConditionField

      public int getConditionField()
      Returns:
      Value
      See Also:
      • EditFieldType.getConditionField()
    • getEnableMaximize

      public short getEnableMaximize()
      Returns:
      Value
      See Also:
      • EditFieldType.getEnableMaximize()
    • getFName

      public String getFName()
      Returns:
      Value
      See Also:
      • EditFieldType.getFName()
    • getFont

      public com.saperion.ngc.iform.xml.FontType getFont()
      Returns:
      Value
      See Also:
      • EditFieldType.getFont()
    • getLimit

      public String getLimit()
      Description copied from interface: IntelligentField
      Returns the limit of this field (upper, lower or both).
      Specified by:
      getLimit in interface IntelligentField
      Returns:
      Value
      See Also:
      • EditFieldType.getLimit()
    • getListVersion

      public long getListVersion()
      Returns:
      Value
      See Also:
      • EditFieldType.getListVersion()
    • getMandatory

      public com.saperion.ngc.iform.xml.OverrideKindType getMandatory()
      Returns:
      Value
      See Also:
      • EditFieldType.getMandatory()
    • getPos

      public com.saperion.ngc.iform.xml.PosType getPos()
      Returns:
      Value
      See Also:
      • EditFieldType.getPos()
    • getResFieldCnt

      public int getResFieldCnt()
      Returns:
      Value
      See Also:
      • EditFieldType.getResFieldCnt()
    • getResStyle

      public int getResStyle()
      Returns:
      Value
      See Also:
      • EditFieldType.getResStyle()
    • getVarDataType

      public short getVarDataType()
      Returns:
      Value
      See Also:
      • EditFieldType.getVarDataType()
    • getWxCombo

      public int getWxCombo()
      Returns:
      Value
      See Also:
      • EditFieldType.getWxCombo()
    • getWyCombo

      public int getWyCombo()
      Returns:
      Value
      See Also:
      • EditFieldType.getWyCombo()
    • getXCombo

      public int getXCombo()
      Returns:
      Value
      See Also:
      • EditFieldType.getXCombo()
    • isAllowInactiveLookup

      public boolean isAllowInactiveLookup()
      Returns:
      Value
      See Also:
      • EditFieldType.isAllowInactiveLookup()
    • isAutoComplete

      public boolean isAutoComplete()
      Returns:
      Value
      See Also:
      • EditFieldType.isAutoComplete()
    • isBEnabled

      public boolean isBEnabled()
      Returns:
      Value
      See Also:
      • EditFieldType.isBEnabled()
    • isBPersistent

      public boolean isBPersistent()
      Returns:
      Value
      See Also:
      • EditFieldType.isBPersistent()
    • isHideButtons

      public boolean isHideButtons()
      Returns:
      Value
      See Also:
      • EditFieldType.isHideButtons()
    • isIsVar

      public boolean isIsVar()
      Returns:
      Value
      See Also:
      • EditFieldType.isIsVar()
    • isPersistVar

      public boolean isPersistVar()
      Returns:
      Value
      See Also:
      • EditFieldType.isPersistVar()
    • isRestrictCursor

      public boolean isRestrictCursor()
      Returns:
      Value
      See Also:
      • EditFieldType.isRestrictCursor()
    • isSaveLayout

      public boolean isSaveLayout()
      Returns:
      Value
      See Also:
      • EditFieldType.isSaveLayout()
    • isUseCalendar

      public boolean isUseCalendar()
      Returns:
      Value
      See Also:
      • EditFieldType.isUseCalendar()
    • setAlign

      public void setAlign(com.saperion.ngc.iform.xml.AlignType value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setAlign(com.saperion.ngc.iform.xml.AlignType)
    • setAllowInactiveLookup

      public void setAllowInactiveLookup(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setAllowInactiveLookup(boolean)
    • setAutoComplete

      public void setAutoComplete(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setAutoComplete(boolean)
    • setBEnabled

      public void setBEnabled(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setBEnabled(boolean)
    • setBPersistent

      public void setBPersistent(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setBPersistent(boolean)
    • setColorError

      public void setColorError(long value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setColorError(long)
    • setColorOk

      public void setColorOk(long value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setColorOk(long)
    • setConditionField

      public void setConditionField(int value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setConditionField(int)
    • setEnableMaximize

      public void setEnableMaximize(short value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setEnableMaximize(short)
    • setFName

      public void setFName(String value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setFName(java.lang.String)
    • setFont

      public void setFont(com.saperion.ngc.iform.xml.FontType value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setFont(com.saperion.ngc.iform.xml.FontType)
    • setHideButtons

      public void setHideButtons(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setHideButtons(boolean)
    • setIsVar

      public void setIsVar(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setIsVar(boolean)
    • setLimit

      public void setLimit(String value)
      Description copied from interface: IntelligentField
      Sets the limit type. Possible values are: 'lower', 'upper', 'both'.
      Specified by:
      setLimit in interface IntelligentField
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setLimit(com.saperion.ngc.iform.xml.LimitType)
    • setListVersion

      public void setListVersion(long value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setListVersion(long)
    • setMandatory

      public void setMandatory(com.saperion.ngc.iform.xml.OverrideKindType value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setMandatory(com.saperion.ngc.iform.xml.OverrideKindType)
    • setPersistVar

      public void setPersistVar(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setPersistVar(boolean)
    • setPos

      public void setPos(com.saperion.ngc.iform.xml.PosType value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setPos(com.saperion.ngc.iform.xml.PosType)
    • setResFieldCnt

      public void setResFieldCnt(int value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setResFieldCnt(int)
    • setResStyle

      public void setResStyle(int value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setResStyle(int)
    • setRestrictCursor

      public void setRestrictCursor(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setRestrictCursor(boolean)
    • setSaveLayout

      public void setSaveLayout(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setSaveLayout(boolean)
    • setUseCalendar

      public void setUseCalendar(boolean value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setUseCalendar(boolean)
    • setVarDataType

      public void setVarDataType(short value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setVarDataType(short)
    • setWxCombo

      public void setWxCombo(int value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setWxCombo(int)
    • setWyCombo

      public void setWyCombo(int value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setWyCombo(int)
    • setXCombo

      public void setXCombo(int value)
      Parameters:
      value - Value
      See Also:
      • EditFieldType.setXCombo(int)
    • getElementType

      public IntelligentField.ElementType getElementType()
      Returns the type of this element. The type defines the kind of data and control used for this IntelligentField. See IntelligentField.ElementType for a list of types.
      Specified by:
      getElementType in interface IntelligentField
      Returns:
      Element type
      See Also:
    • getResultBean

      public FieldResultBean getResultBean()
      Returns a bean containing the current value, type, name and limit of this field.
      Specified by:
      getResultBean in interface IntelligentField
      Returns:
      Result bean
      See Also:
    • getEventtarget

      public Set<org.zkoss.zk.ui.Component> getEventtarget(String eventName)
      Reads the event target for the given event name, if set or the root element.
      Specified by:
      getEventtarget in interface EventChild
      Parameters:
      eventName - Event name or null for main target
      Returns:
      Set of event targets
      See Also:
    • setEventtarget

      public void setEventtarget(org.zkoss.zk.ui.Component comp, String eventName)
      Set the event target.
      Specified by:
      setEventtarget in interface EventChild
      Parameters:
      comp - Event target
      eventName - Event name or null for main target
      See Also:
    • postFormButtonEvent

      public void postFormButtonEvent(ButtonInfo info)
      Posts a FormButtonEvent.
      Parameters:
      info - information about the button pressed
      See Also:
    • postFieldChangeEvent

      public void postFieldChangeEvent(ResultProperty property)
      Posts a FieldChangeEvent.
      Parameters:
      property - the property that was changed
      See Also:
    • getFieldName

      public String getFieldName()
      Returns the name of the field.
      Specified by:
      getFieldName in interface IntelligentField
      Returns:
      Field name
      See Also:
    • isContentValid

      public boolean isContentValid()
      Performs a validation and returns true, if the content is valid.
      Specified by:
      isContentValid in interface IntelligentField
      Returns:
      Field content is valid.
      See Also:
    • getEditField

      public com.saperion.ngc.iform.xml.EditFieldType getEditField()
      Returns the EditFieldType defining the properties of this field.
      Specified by:
      getEditField in interface IntelligentField
      Returns:
      the edit field
      See Also:
    • setDefaultValue

      public void setDefaultValue(String valueAsString)
      Sets the default value.
      Specified by:
      setDefaultValue in interface IntelligentField
      Parameters:
      valueAsString - string representation of value
      See Also:
    • setFieldInactive

      public void setFieldInactive(boolean inactive)
      Sets the fieldInactive parameter. Same as setReadonly(inactive).
      Specified by:
      setFieldInactive in interface IntelligentField
      Parameters:
      inactive - value
      See Also:
    • isFieldInactive

      public boolean isFieldInactive()
      Returns the fieldInactive parameter.
      Specified by:
      isFieldInactive in interface IntelligentField
      Returns:
      fieldInactive
      See Also:
    • setDisabled

      public void setDisabled(boolean disabled)
      Set disabled state.
      Specified by:
      setDisabled in interface IntelligentField
      Overrides:
      setDisabled in class Tristate
      Parameters:
      disabled - value
      See Also:
      • InputElement.setDisabled(boolean)
    • setReadonly

      public void setReadonly(boolean readonly)
      Sets the readonle state of this field.
      Specified by:
      setReadonly in interface IntelligentField
      Parameters:
      readonly - readonly
      See Also:
    • isReadonly

      public boolean isReadonly()
      gets the readonly state of this field.
      Specified by:
      isReadonly in interface IntelligentField
      See Also:
      • InputElement.setReadonly(boolean)
    • setFieldName

      public void setFieldName(String name)
      Sets the name of the field. The name is required to be the same as in the database table representing the DDC used.
      Specified by:
      setFieldName in interface IntelligentField
      Parameters:
      name - field name
      See Also:
    • validate

      public void validate()
      Starts validation of the field.
      Specified by:
      validate in interface IntelligentField
      See Also:
    • clearErrorMessage

      public void clearErrorMessage()
      Removes the validation error message if present.
      Specified by:
      clearErrorMessage in interface IntelligentField
      See Also:
    • getParentForm

      public IntelligentFormView getParentForm()
      Returns the parent form or null if this field is not part of a form.
      Specified by:
      getParentForm in interface IntelligentField
      Returns:
      parent form or null
      See Also:
    • setChangedImplicitly

      public void setChangedImplicitly()
      Sets the changed-property of this field to true.
      Specified by:
      setChangedImplicitly in interface IntelligentField
      See Also:
    • setChangedImplicitly

      public void setChangedImplicitly(boolean fireChangedEvent)
      Sets the changed-property of this field to true.
      Specified by:
      setChangedImplicitly in interface IntelligentField
      Parameters:
      fireChangedEvent - if true, a Events.ON_CHANGE event will be fired
      See Also:
    • updateAttribute

      public void updateAttribute(String attr, Object value)
      Performs a smartUpdate on the specified attribute.
      Specified by:
      updateAttribute in interface IntelligentField
      Parameters:
      attr - attribute name
      value - attribute value
      See Also:
    • isNoLocalize

      public boolean isNoLocalize()
      Description copied from interface: Localized
      Returns the noLocalize parameter.
      Specified by:
      isNoLocalize in interface Localized
      Returns:
      noLocalize
    • setNoLocalize

      public void setNoLocalize(boolean noLocalize)
      Description copied from interface: Localized
      Sets the noLocalize parameter that can be used to disable localization of this component.
      Specified by:
      setNoLocalize in interface Localized
      Parameters:
      noLocalize - value
    • generateUUID

      public String generateUUID()
      Specified by:
      generateUUID in interface Identifiable
      Returns:
      the generated uuid for the DOM tree
    • toString

      public String toString()
      Overrides:
      toString in class org.zkoss.zk.ui.AbstractComponent
      See Also:
      • AbstractComponent.toString()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface IntelligentField
      Returns:
      true if the field's value is empty.
      See Also:
    • setTabindex

      public void setTabindex(int index)
      This method is not supported in TristateField and does nothing.
      Specified by:
      setTabindex in interface IntelligentField
      Overrides:
      setTabindex in class org.zkoss.zk.ui.HtmlBasedComponent
      Parameters:
      index - tabindex
    • getTabindex

      public int getTabindex()
      Specified by:
      getTabindex in interface IntelligentField
      Overrides:
      getTabindex in class org.zkoss.zk.ui.HtmlBasedComponent
      Returns:
      the tabindex of this field.
    • clear

      public void clear()
      Description copied from interface: IntelligentField
      Clears the value(s) of this field.
      Specified by:
      clear in interface IntelligentField