psdi.webclient.system.controller

Class BoundComponentInstance

    • Field Detail

      • HAS_LONG_DESCRIPTION

        public static final java.lang.String HAS_LONG_DESCRIPTION
        See Also:
        Constant Field Values
      • LONGDESC_ATTRIBUTE_SUFFIX

        public static final java.lang.String LONGDESC_ATTRIBUTE_SUFFIX
        See Also:
        Constant Field Values
      • bound

        public boolean bound
      • cachedReadonlyState

        protected boolean cachedReadonlyState
      • cachedReadonlyStateMap

        protected java.util.HashMap cachedReadonlyStateMap
      • cachedMaskedState

        protected boolean cachedMaskedState
      • cachedRequiredState

        protected boolean cachedRequiredState
      • cachedRequiredStateMap

        protected java.util.HashMap cachedRequiredStateMap
      • cachedDataValue

        protected java.lang.String cachedDataValue
      • cachedDataValueMap

        protected java.util.HashMap cachedDataValueMap
      • cachedErrorMap

        protected java.util.HashMap cachedErrorMap
      • cachedLongDesc

        protected boolean cachedLongDesc
      • cachedLongDescMap

        protected java.util.HashMap cachedLongDescMap
      • cachedLookup

        protected java.lang.String cachedLookup
      • cachedLookupMap

        protected java.util.HashMap cachedLookupMap
      • cachedAppLink

        protected java.lang.String cachedAppLink
      • cachedAppLinkMap

        protected java.util.HashMap cachedAppLinkMap
      • dataChanged

        protected boolean dataChanged
      • readonlyChanged

        protected boolean readonlyChanged
      • requiredChanged

        protected boolean requiredChanged
      • longDescChanged

        protected boolean longDescChanged
      • errorChanged

        protected boolean errorChanged
      • isDataValid

        protected boolean isDataValid
      • supportsLongDesc

        protected boolean supportsLongDesc
      • ignoreDataChange

        protected boolean ignoreDataChange
      • ignoreReadonlyChange

        protected boolean ignoreReadonlyChange
      • ignoreRequiredChange

        protected boolean ignoreRequiredChange
      • dataValueInError

        protected java.lang.String dataValueInError
    • Constructor Detail

      • BoundComponentInstance

        public BoundComponentInstance()
    • Method Detail

      • updateCachedDataValue

        public void updateCachedDataValue(java.lang.String value)
      • hasChanged

        public boolean hasChanged()
        Returns true if there has been a change to the component's data, readonly, or required states. To find out what specifically has changed use the hasDataChanged(), hasReadonlyChanged(), hasRequiredChanged() methods. NOTE: This method will update the cached data, readonly, and required values to the new values.
        Overrides:
        hasChanged in class DynamicAttributeComponent
        See Also:
        BoundComponentInstance.hasChanged()
      • hasDataChanged

        public boolean hasDataChanged()
        Returns the value of the datachanged flag that was set by the a call to hasChanged(). Returns true if the component's data has changed. Also resets the datachanged flag to false.
      • hasLongDescChanged

        public boolean hasLongDescChanged()
        Returns the value of the longDescChanged flag that was set by the a call to hasChanged(). Returns true if the component's long desc state has changed. Also resets the longDescChanged flag to false.
      • hasReadonlyChanged

        public boolean hasReadonlyChanged()
        Returns the value of the readonlychanged flag that was set by the a call to hasChanged(). Returns true if the component's readonlyness has changed. Also resets the readonlychanged flag to false.
      • hasRequiredChanged

        public boolean hasRequiredChanged()
        Returns the value of the requiredchanged flag that was set by the a call to hasChanged(). Returns true if the component's requiredness has changed. Also resets the requiredchanged flag to false.
      • setDataValid

        public void setDataValid(boolean isDataValid)
        For interaction with DataBean.setvalue()
      • isDataValid

        public boolean isDataValid()
        Returns:
        true when the data in the bound component is the same as the data on the bean`
      • getInputMode

        public java.lang.String getInputMode()
        Returns the value of the component's inputmode property. If the component's inputmode is not set then the method checks to see if there is a linked component (defined by the linkedcomponent property) and returns the linked component's inputmode. The returned inputmode is converted to all lowercase.
        Returns:
        the value of the inputmode property or ""
      • getInputModeWithoutPasswordPrefix

        public java.lang.String getInputModeWithoutPasswordPrefix()
        Returns the inputmode without the password prefix.
      • initialize

        public void initialize()
        Called when the app broadcasts an "initialize" event to all components. Loads the component's properties from the mbo.
        Overrides:
        initialize in class DynamicAttributeComponent
      • getString

        public java.lang.String getString()
        Returns the component's value as a String.
      • getDataBeanRow

        protected int getDataBeanRow()
      • getBoolean

        public boolean getBoolean()
        Returns the component's value as a boolean. If the value is null false is returned as it's assumed that a checkbox is asking for the value to know if it needs to be checked or not.
      • readOnlyCheck

        public void readOnlyCheck()
                           throws MXException
        Throws an MXApplicationException("jspmessages", "fieldreadonly") if the component (or the linked component) is read only. Call isReadOnly() if you just want to know if the component is readonly without the exception.
        Throws:
        MXException - if the component is readonly
      • isReadOnly

        public boolean isReadOnly()
        Returns true if this component (or linked component) is defined as readonly in the mbo, or if the inputmode is readonly in the presentation xml.
      • isRequired

        public boolean isRequired()
        Returns true if this component is defined as required in the mbo, or if the inputmode is required in the presentation xml.
      • getLongDescription

        public java.lang.String getLongDescription()
        Returns the long description value of this component.
      • hasLongDescription

        public boolean hasLongDescription()
        Returns true if the component actually has a non-empty long description value.

        Note: this is different from the HAS_LONG_DESCRIPTION property which only indicates whether the component IS ALLOWED to have a long description.

      • applink

        public int applink()
                    throws java.rmi.RemoteException,
                           MXException
        Handler for the applink event. Sets an internal flag that when seen by jsp signals it to send the browser to the linked application.

        It is expected that only textbox components will be receiving this event. Only textbox.jsp checks for the flag set here

        Returns:
        EventQueue.PROCESS_NEXT_EVENT
        Throws:
        java.rmi.RemoteException
        MXException
      • selectvalue

        public int selectvalue()
                        throws MXException
        Handler for the selectvalue event
        Returns:
        EventQueue.PROCESS_NEXT_EVENT
        Throws:
        MXException
      • isOnCurrentRow

        public boolean isOnCurrentRow()
      • isRowDeleted

        public boolean isRowDeleted()
      • getQbeNameWithPrepend

        public java.lang.String getQbeNameWithPrepend()
      • processProfile

        public int processProfile(java.lang.String profileName)
        Returns:
        PROCESS_NEXT_EVENT,EVENT_STOP_ALL
      • getDataBean

        public DataBean getDataBean()
        Description copied from class: ComponentInstance
        Return the databean that is defined by the component's control's datasrc property. Will return null is datasrc property is null or the datasrc/databean isn't instantiated within the component's AppInstance.
        Overrides:
        getDataBean in class ComponentInstance
      • exceptionhandled

        public int exceptionhandled()
      • datelookup

        public int datelookup()
        Prepares a collection of information before datepopup is called. Launches the correct datepopup by checking the datatype
        Returns:
        WebClientBean.EVENT_HANDLED;
      • isDefault

        public boolean isDefault()
        Returns whether the component is a default field or not. (Sets a default value.)
        Returns:
        true:default field - false: not a default field
      • isQuery

        public boolean isQuery()
        Returns whether the component is a query field or not. (Sets a qbe value.)
        Returns:
        true:query field - false: not a query field
      • instantiatedatasrc

        public void instantiatedatasrc()
        A broadcast event method that binds the component to the component's databean.
      • getDataType

        public int getDataType()
        Return the max data type of the attribute the component is bound to. Compare values to MXFormat data type constants.
      • isMasked

        public boolean isMasked()
        Check the inputmode property along with the BoundComponents MboValueData to see if the component is masked.
        Overrides:
        isMasked in class ComponentInstance
        Returns:
        Returns true if the component's data is masked, false it is not.
        See Also:
        ComponentInstance.isMasked()
      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Needed to override this method to cache original values for data, readonly, required and applink
        Overrides:
        render in class DynamicAttributeComponent
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        See Also:
        ComponentInstance.render()
      • getDataValueInError

        public java.lang.String getDataValueInError()
        Used to get the invalid value entered into component
        Parameters:
        comp -
      • setDataValueInError

        public void setDataValueInError(java.lang.String s)
        Used to set/store an invalid value entered into component
      • getLinkBack

        public ComponentInstance getLinkBack()
        Used to get the original component in a linkedcomponent scenario
      • dataRestrictionCheck

        public boolean dataRestrictionCheck()
        Returns true if there is a field level data restriction on the attribute preventing the control from being visible.
      • increment

        public int increment()
        Called from front end when the field data type is DATE, TIME of DATETIME This even can only be called when user presses UP_ARROW keys on date fields.
        Returns:
        WebClientBean.EVENT_HANDLED
      • decrement

        public int decrement()
                      throws MXException
        Called from front end when the field data type is DATE, TIME of DATETIME This even can only be called when user presses DOWN_ARROW keys on date fields.
        Returns:
        WebClientBean.EVENT_HANDLED
        Throws:
        MXException
      • setcurrentdate

        public int setcurrentdate()
                           throws MXException
        Called from front end when the field data type is DATE, TIME of DATETIME This even can only be called when user presses SHIFT + 7 (for &) or SHIFT + UP ARROW
        Returns:
        WebClientBean.EVENT_HANDLED
        Throws:
        MXException
        Since:
        Maximo7.1.1.5
      • setBoundAsRequired

        public void setBoundAsRequired()
        Deprecated. This method is no longer needed as the boundAsRequired is not longer needed. Instead call madeRequiredConditionally on the DataBean the component is bound to.
        Set boundAsRequired equal to true, which states that the databean think this component's attribute is required.
      • requiredCheck

        protected void requiredCheck()
        Checks to see if the requiredness of the boundcomponent has changes and whether or not to change the attribute's requireness on the databean (and it's mbo)
      • popexception

        public int popexception()
                         throws java.io.IOException,
                                MXException
        This event is called when use hovers the mouse over the error or warning icon. This returns input id and exception on which is to be shown.
        Throws:
        java.io.IOException
        MXException
      • getExceptionType

        public int getExceptionType()
        Returns the exception type if any attached to this component.
        Returns:
        exception type {EXCEPTION_WARNING | EXCEPTION_ERROR | EXCEPTION_NONE}
      • removeCurrentError

        public void removeCurrentError()
      • getWarningMessages

        public java.lang.String getWarningMessages()
        Returns warning messages tied to this component if any
      • processAsyncYesNoCancel

        public int processAsyncYesNoCancel()
        Handle the async error tool tip dialog yes/no/cancel button click event
      • processRevert

        public int processRevert()
        Handle the async error tool tip dialog "Go Back" button click event
        Returns:
        WebClientBean.EVENT_HANDLED
      • processIgnoreWarning

        public int processIgnoreWarning()
        Handle the async error tool tip dialog "Use My Value" button click event
      • processEdit

        public int processEdit()
        Handle the async error tool tip dialog "Edit My Value" button click event
      • isRevert

        public boolean isRevert()
        Check if Revert button is clicked
      • resetIsRevert

        public void resetIsRevert()
        Reset the revertvalue
      • hasWarnings

        public boolean hasWarnings()
        Check if warning exists
      • getCurrentError

        public SetValueError getCurrentError()
        Returns the current SetValueError for this BoundComponent. A BoundComponent can have multiple errors if it's within a table. There could be an error for the same attribute on different rows (mbos) in the table. Also if the table the bound component is within is a child table to another table, so the MboSet the bound component is "bound" to can change as well. So This will return the SetValueError that matches the mboset and row the bound component is currently bound to.
        Returns:
        the current SetValueError for this BoundComponent
      • addAttributeError

        public void addAttributeError(ERMAttributeError attributeError)
        Adds the ERMAttributeError to the BoundComponents error list if the BoundCOmponent does not have another error.
      • addSetValueError

        public void addSetValueError(SetValueError error)
        Adds the SetValueError to the components error list and also bubbles the error up thru the parent container controls. If the list already contains an error for the same Mbo and attribute then the existing error is removed and invalidated.
      • getWarningList

        public java.util.List getWarningList()
        Returns the warning list
      • getHighestErrorLevel

        public int getHighestErrorLevel()
        validates all errors associated with the boundcomponent (there can be multiple if the component is within a table) and returns the highest error level.
        Returns:
        The hight error level for the component.
      • clearErrors

        public void clearErrors()
        Removes all SetValueErrors associated with this BoundComponent
      • getExcDialogIcon

        public java.lang.String getExcDialogIcon(int exceptionType)
        Get tooltip dialog error icon
        Returns:
        icon filename with path
      • isPasswordField

        public boolean isPasswordField()
        Check if the field is password field Return true if this is a password field
      • retryErrorValues

        public boolean retryErrorValues()
        This method will loop thru all the errors set on the BoundComponent and try setting the errored values again. If the value are taken (no errors) then the error is removed otherwise the original error is replaced by the new one.
        Returns:
        true if the componented still has errors, false if it doesn't.
      • getErrorForRow

        public SetValueError getErrorForRow(int row)
        Return the error level for the error assiciated with the passed in row. If there isn't an error for tha row EXCEPION_NONE is returned.
      • isSmartFillEnabled

        public boolean isSmartFillEnabled(MboValueData mvd)
        Returns true if the BoundComponentInstance is smartfill enabled.
        Parameters:
        mvd - The MboValueData to check to see if it has a lookup defined
      • getFieldInfo

        public com.ibm.json.java.JSONObject getFieldInfo()
        Returns data type information about this attribute to be added as an attribute on a field
      • useMaxLength

        public boolean useMaxLength()
        used to determine whether we can limit the number of entered characters in a field if there is a domain and it has more than the key used in the typeahead we cannot limit so that typeahead searching will work
        Returns:
      • getRenderIdForAutoFill

        public java.lang.String getRenderIdForAutoFill()
        Returns the renderid to be used by the autofill info. If the component is on a table row the id will be in this format: (render id of the component}|{render id of the table body component}
      • clearClassification

        public int clearClassification()
                                throws java.rmi.RemoteException,
                                       MXException
        IJ04006:Can still clear classification when conditional UI sets the field CLASSSTRUCTURE_HIERARCHYPATH readonly, clear Classification is one menu item of the menu CLASSIFICATION
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getReadonlyStateMap

        public java.util.HashMap getReadonlyStateMap()