psdi.webclient.system.controller

Class ComponentInstance

    • Field Detail

      • changedFlag

        protected boolean changedFlag
      • CONTAINER_WARNING_IMAGE

        public static final java.lang.String CONTAINER_WARNING_IMAGE
        See Also:
        Constant Field Values
      • CONTAINER_ERROR_IMAGE

        public static final java.lang.String CONTAINER_ERROR_IMAGE
        See Also:
        Constant Field Values
      • CONTAINER_WARNING

        public static final java.lang.String CONTAINER_WARNING
        See Also:
        Constant Field Values
      • LOG_CATEGORY

        public static final Category LOG_CATEGORY
      • popDefinition

        public com.ibm.json.java.JSONObject popDefinition
    • Constructor Detail

      • ComponentInstance

        public ComponentInstance()
    • Method Detail

      • hiddenByProperty

        public boolean hiddenByProperty()
        Allows hiding components via the registry without coding, by using property value comparison Ex: @{label}==null Ex2: @{cssclass}!=null Can have two conditions or more Ex3: @{label}!=null and @{cssclass}!=null Ex4: @{label}!=null or @{cssclass}!=null
      • initialize

        public void initialize()
        should be extended to do any setup required by the instance. for example, the DatasrcInstance will call initialize to create datasources found in the bind list.
        Overrides:
        initialize in class BaseInstance
      • hiddenByProp

        public boolean hiddenByProp(java.lang.String hideWhen)
      • createChangedPropList

        protected void createChangedPropList()
      • getCurrent

        public static ComponentInstance getCurrent(javax.servlet.ServletRequest request)
        Gets the current component instance from the request or session
        Parameters:
        request - the current ServletRequest object, typically comes from the jsp
      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Renders the component.

        If a component is marked with a rendercomponent, it will be set to the control so that the children can check to see if their renderid matches. If it does, they will render.

        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • isHoversActive

        public boolean isHoversActive()
      • setIsHoversActive

        public void setIsHoversActive(boolean aBool)
      • getControl

        public ControlInstance getControl()
        Get the control in which this component resides
      • renderChildrenControls

        public void renderChildrenControls()
                                    throws java.lang.NoSuchMethodException,
                                           java.lang.IllegalAccessException,
                                           java.lang.reflect.InvocationTargetException
        Call renderChildren() on the control
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • renderChildComponents

        public void renderChildComponents()
                                   throws java.lang.NoSuchMethodException,
                                          java.lang.IllegalAccessException,
                                          java.lang.reflect.InvocationTargetException
        Walk through all child components and call render on them in the correct order
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • isChild

        public boolean isChild(org.w3c.dom.Element child)
      • isComponent

        public boolean isComponent(org.w3c.dom.Element component)
      • hasChildren

        public boolean hasChildren()
      • hasComponents

        public boolean hasComponents()
      • getChildrenDesignOnly

        public boolean getChildrenDesignOnly()
      • hasChanged

        public boolean hasChanged()
        Has something changed requiring this component to get a render?
      • rerendering

        public boolean rerendering()
        Returns true if it's control needs render and it's controls parent does not
      • needsRender

        public boolean needsRender()
        Returns true if it's control needs render, false if it is a refresh
      • broadcastEvent

        public int broadcastEvent(WebClientEvent event)
                           throws java.lang.NoSuchMethodException,
                                  java.lang.IllegalAccessException,
                                  java.lang.reflect.InvocationTargetException
        Method will call handle event on this component and all of it's child components. This is used to send an event down through the entire component hierarchy as long as each subsequent component returns the proper handled status: If any component returns EVENT_STOP_ALL, the broadcast is halted. Currently called from WebClientRuntime.broadcastEvent() which passes an event down through the entire control/component hierarchy.
        Returns:
        event status
        Throws:
        java.lang.NoSuchMethodException - @deprecated This method should not throw this exception, just return EVENT_CONTINUE //TODO remove in the next major release
        java.lang.IllegalAccessException - @deprecated This method should not throw this exception, just return EVENT_CONTINUE //TODO remove in the next major release
        java.lang.reflect.InvocationTargetException - @deprecated This method should not throw this exception, just return EVENT_CONTINUE //TODO remove in the next major release
      • action

        public int action()
        Action ToolbarCombobox
      • query

        public int query()
        Query ToolbarCombobox
      • showMenubarMenu

        public int showMenubarMenu()
        For menu bar menus
      • signout

        public void signout()
                     throws java.rmi.RemoteException,
                            MXException
        Handles signout mxevent
        Throws:
        java.rmi.RemoteException
        MXException
      • showMenu

        public int showMenu()
      • click

        public int click()
                  throws java.rmi.RemoteException,
                         MXException
        Handles a click event. Tries to call the method named in the "mxevent" property on the system handler, then component, then the control. Then eventually calls the bean method If "targetid" property is defined then that component is used, otherwise this component is used.
        Returns:
        event handler status code
        Throws:
        java.rmi.RemoteException
        MXException
      • canChangeRowFocus

        public boolean canChangeRowFocus()
        Clicking on this component should also change the focus on the table row.
        Returns:
      • formatLabel

        public java.lang.String formatLabel(java.lang.String settingKey,
                                            java.lang.String label)
        This method formats the label used by a control. The label format is obtained from setting.properties using the passed in property key. If no key is passed in or the property isn't found, then the default format will be used, which comes from the "defaultlabelformat" property in setting.property. The label is formatted using the java.text.MessageFormat format method. See that class to get the proper format to use.
        Parameters:
        settingKey - the key in setting.properties that contains the format to use with the label
        label - the label o be formatted
        Returns:
        the formatted label
        See Also:
        Format.format(Object obj)
      • formatLabel

        public java.lang.String formatLabel(java.lang.String label)
        This method formats the label used by a control. The label format is obtained from setting.properties using a key string which is a concatination of the control type's and "labelformat" (Example: checkboxlabelformat). If the control's property isn't found, then the default format will be used, which comes from the "defaultlabelformat" property in setting.property. The label is formatted using the java.text.MessageFormat format method. See that class to get the proper format to use.
        Parameters:
        label - the label to be formatted
        Returns:
        the formatted label
        See Also:
        Format.format(Object obj)
      • setLabelFormat

        public void setLabelFormat(java.lang.String settingKey)
      • setChangedFlag

        public void setChangedFlag()
        Sets the generic changed flag to force hasChanged() to return true
      • setChangedFlag

        public void setChangedFlag(boolean flag)
        Sets the generic changed flag.
      • clearChangedFlag

        public void clearChangedFlag()
        Clears the generic changed flag. Must be called after calling hasChanged().
      • setFocus

        public void setFocus()
                      throws MXException
        Allows programmatic setting of focus item. This will receive focus.
        Throws:
        MXException
      • getClickState

        public int getClickState()
        Returns whether or not this item is clickable. Uses clickablesate property on the component.
        • NOT_CLICKABLE Does not have an MXEVENT
        • CLICKABLE_OFF Has MXEVENT, but cannot be clicked now
        • CLICKABLE_ON Has MXEVENT and can be clicked now
        Returns:
        the state
      • findProperty

        @TraceDisabled
        public java.lang.String findProperty(java.lang.String key)
      • getLinkedComponentInstance

        public ComponentInstance getLinkedComponentInstance()
        Returns the linked component instance if the linkedcomponent property for the component is set.
      • getMenuType

        public java.lang.String getMenuType()
      • getLookupName

        public java.lang.String getLookupName()
      • getApplink

        public java.lang.String getApplink()
      • isOnTableFilterRow

        public boolean isOnTableFilterRow()
      • isOnTableTitleRow

        public boolean isOnTableTitleRow()
      • setComponentContainerId

        public void setComponentContainerId(java.lang.String id)
      • getComponentContainerId

        public java.lang.String getComponentContainerId()
      • controlPropertyChanged

        public void controlPropertyChanged(java.lang.String property)
      • isVisible

        public boolean isVisible()
        Description copied from class: BaseInstance
        Return whether or not the instance is visible or not (Whether or not it should be shown) Each control or component will handle visibility in it's own way.
        Overrides:
        isVisible in class BaseInstance
        Returns:
        Returns true if the component is visible, false it is not.
      • getCssClass

        public java.lang.String getCssClass()
      • isDefaultRender

        public boolean isDefaultRender()
      • isDisabled

        public boolean isDisabled()
        Returns:
        Returns true if the component is disabled, false it is not.
      • isMasked

        public boolean isMasked()
      • hasMaskedChanged

        public boolean hasMaskedChanged()
      • propertyChanged

        protected void propertyChanged(java.lang.String property)
        Description copied from class: BaseInstance
        Adds the property to the changed property list if not already there.
        Overrides:
        propertyChanged in class BaseInstance
        Parameters:
        property - - the property that was changed
      • getDesignerSelected

        public boolean getDesignerSelected()
        Is this component selected in the app designer
      • skipRender

        public boolean skipRender()
        Used to prevent refresh evaluation of the components of a page or a dialog to improve performance
        Returns:
        true when not doing an actual render (including re-render), not in design mode (interactive use of modeless dialogs) and this instance is not on the current page
      • getId

        public java.lang.String getId()
        Overrides:
        getId in class BaseInstance
        Returns:
        Returns the id.
      • getIdWithoutRow

        public java.lang.String getIdWithoutRow()
      • getId

        public java.lang.String getId(boolean useRow)
      • getDataBean

        public DataBean getDataBean()
        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.
      • isIncluded

        public boolean isIncluded()
      • isAsyncEnabled

        public boolean isAsyncEnabled()
        Returns whether or not async is allowed on this component. This checks the app and system setting as well since they take precedence to turn async off.
        Returns:
        boolean is async enabled at the app, system and component level
      • updateStyle

        public void updateStyle(java.lang.String attribute,
                                java.lang.String value)
        Add style and value to list of styles to be updated on refresh
        Parameters:
        attribute - Attribute name
        value - Attribute value
      • updateStyle

        public void updateStyle(java.lang.String style)
        Add attribute and value to list of styles to be updated on refresh
        Parameters:
        style - Attribute style (style:value)
      • updateAttribute

        public void updateAttribute(java.lang.String attribute,
                                    java.lang.String value)
        Add attribute and value to list to be updated on refresh
        Parameters:
        attribute - Attribute name
        value - Attribute value
      • getUpdatedStyles

        public com.ibm.json.java.JSONArray getUpdatedStyles()
        Return and clear the currently updated list of html styles and their values
        Returns:
        Array of updated styles and values
      • getUpdatedAttributes

        public com.ibm.json.java.JSONArray getUpdatedAttributes()
        Return and clear the currently updated list of html attributes and their values
        Returns:
        Array of updated attributes and values
      • getCurrentUpdates

        public java.lang.String getCurrentUpdates()
        Get entire update object as a JSON string (this includes styles and attributes)
        Returns:
        JSON formatted update string containing all updated styles and attributes
      • hasUnappliedUIUpdates

        public boolean hasUnappliedUIUpdates()
        Does this component have unapplied style or attribute changes that must be processed?
        Returns:
      • clearUIUpdates

        public void clearUIUpdates()
        Clears all update attributes and styles for this component. This gets called at the end of component.render.
      • getErrorInfo

        public ContainerErrorInfo getErrorInfo()
        Returns an error information object for container controls. the object contains: type: error/warning, image: image to display, message: to use for the tooltip will return null if no icon should be shown.
      • getLabelledByRenderId

        public java.lang.String getLabelledByRenderId()
        Returns the render id of the component set in the labelby property of the component. If the labelby property contains more than one component (it can be a comma delimited list), this method will return the first component in the list that has been instantiated and visible. This method will return null if the labelby property isn't set or any of the components listed in the labelby property haven't been instantiated or visible.
      • getLabelForRenderId

        public java.lang.String getLabelForRenderId()
        Returns the render id of the component set in the labelfor property of the component. If the labelfor property contains more than one component (it can be a comma delimited list), this method will return the first component in the list that has been instantiated and visible. This method will return null if the labelfor property isn't set or any of the components listed in the labelfor property haven't been instantiated or visible.
      • findComponentByDescriptorId

        public ComponentInstance findComponentByDescriptorId(java.lang.String id)
        This method searches the child component list of this component for the component whose descriptor id matches passed in id. The descriptor id is different than the instance id because typically the instance id will have the control's id included in it. The descriptor id is the qualified id as defined in the control-registry component definition for the control. This method will search down thru the component tree of this component.
      • fetchtooltip

        public int fetchtooltip()
                         throws MXException,
                                java.rmi.RemoteException
        Allows us to place an extended custom tooltip on components. Will retrieve content from OSCL Preview, maxmessages or can call a custom method on the component or bean This is a handler for a client generated event and should be called as HIGH_ASYNC
        Returns:
        int event status
        Throws:
        MXException
        java.rmi.RemoteException
      • getFocusRenderId

        public java.lang.String getFocusRenderId()