com.smartgwt.client.widgets.form.fields

## Class LinkItem

- java.lang.Object
- - com.smartgwt.client.core.JsObject
  - - com.smartgwt.client.core.DataClass
    - - com.smartgwt.client.core.RefDataClass
      - - com.smartgwt.client.widgets.form.fields.FormItem
        - - com.smartgwt.client.widgets.form.fields.StaticTextItem
          - - com.smartgwt.client.widgets.form.fields.LinkItem

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPendingStatusChangedHandlers, HasPickerIconClickHandlers, HasShowContextMenuHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers, HasValueHoverHandlers, HasValueIconClickHandlers

      public class LinkItem
      extends StaticTextItem

  A form item that displays a URL. In the default read-only mode (`canEdit` is `false`) the URL is shown as a link; in editable mode the URL is shown in a textbox.

  The link to open is specified as the item value with `FormItem.setValue()` or `FormItem.defaultValue`. The link title defaults to the URL unless `linkTitle` is specified.

  Additionally, a custom action can be triggered when the link is clicked: see `target` for details.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.smartgwt.client.widgets.form.fields.FormItem

      `FormItem.CustomStateGetter, FormItem.StateCustomizer`

  - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.widgets.form.fields.FormItem

      `scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefault`

    - ### Fields inherited from class com.smartgwt.client.core.RefDataClass

      `id`

    - ### Fields inherited from class com.smartgwt.client.core.DataClass

      `factoryCreated, factoryProperties, readOnly`

    - ### Fields inherited from class com.smartgwt.client.core.JsObject

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinkItem()`
    `LinkItem(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `LinkItem(java.lang.String name)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.event.shared.HandlerRegistration` | `addClickHandler(ClickHandler handler)` Add a click handler.
    `static void` | `changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)` Changes the defaults for Canvas AutoChildren named `autoChildName`.
    `static void` | `changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)` Changes the defaults for FormItem AutoChildren named `autoChildName`.
    `static void` | `changePickerIconDefaults(FormItemIcon defaults)`
    `java.lang.Boolean` | `getDisableIconsOnReadOnly()` If `FormItem.canEdit` is set to false, should `icons` be disabled by default?
    `VerticalAlignment` | `getIconVAlign()` How should icons be aligned vertically for this form item.
    `java.lang.String` | `getLinkTitle()` Optional title HTML to display for this item's link.
    `static LinkItem` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `ReadOnlyDisplayAppearance` | `getReadOnlyDisplay()` If `canEdit` is set to `false`, how should this `LinkItem` be displayed to the user?
    `java.lang.String` | `getTarget()` By default, clicking a link rendered by this item opens it in a new browser window.
    `static void` | `setDefaultProperties(LinkItem linkItemProperties)` Class level method to set the default properties of this class.
    `void` | `setDisableIconsOnReadOnly(java.lang.Boolean disableIconsOnReadOnly)` If `FormItem.canEdit` is set to false, should `icons` be disabled by default?
    `void` | `setIconVAlign(VerticalAlignment iconVAlign)` How should icons be aligned vertically for this form item.
    `void` | `setLinkTitle(java.lang.String linkTitle)` Optional title HTML to display for this item's link.
    `void` | `setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)` If `canEdit` is set to `false`, how should this `LinkItem` be displayed to the user?
    `void` | `setTarget(java.lang.String target)` By default, clicking a link rendered by this item opens it in a new browser window.

    - ### Methods inherited from class com.smartgwt.client.widgets.form.fields.StaticTextItem

      `getApplyAlignToText, getApplyHeightToTextBox, getCanSelectText, getClipValue, getDateFormatter, getEditProxyConstructor, getEscapeHTML, getTextBoxStyle, getWrap, setApplyAlignToText, setApplyHeightToTextBox, setCanSelectText, setClipValue, setDateFormatter, setDefaultProperties, setEditProxyConstructor, setEscapeHTML, setTextBoxStyle, setWrap`

    - ### Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem

      `_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPendingStatusChangedHandler, addPickerIconClickHandler, addShowContextMenuHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, addValueIconClickHandler, applyFormula, asSGWTComponent, blurItem, canEditCriterion, clearErrors, clearValue, disable, disableIcon, enable, enableIcon, error, error, errorIfNotCreated, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsObject, getAttributeAsString, getAutoComplete, getBrowserInputType, getBrowserSpellCheck, getCanEdit, getCanEditOpaqueValues, getCanFocus, getCanTabToIcons, getCanvasAutoChild, getCellHeight, getCellStyle, getChangeOnKeypress, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getControlStyle, getCriteriaField, getCriterion, getCriterion, getCursorPosition, getCustomState, getDataPath, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getErrors, getExportFormat, getFetchMissingValues, getFieldName, getFilterLocally, getForeignDisplayField, getForm, getFormat, getFormItemAutoChild, getFormula, getFullDataPath, getGlobalTabIndex, getGridColNum, getGridRowNum, getHeight, getHeightAsString, getHidden, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIconWidth, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLoadingDisplayValue, getLocateItemBy, getMinHintWidth, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionDataSource, getOptionDataSourceAsString, getOptionFilterContext, getOptionOperationId, getOriginalValueMessage, getPageLeft, getPageRect, getPageTop, getPicker, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconSrc, getPickerIconStyle, getPickerIconWidth, getPixelHeight, getPixelWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getReadOnlyHover, getReadOnlyTextBoxStyle, getReadOnlyWhen, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRequiredWhen, getRowSpan, getSaveOnEnter, getScClassName, getSelectedRecord, getSelectOnClick, getSelectOnFocus, getShouldSaveValue, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDeletions, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOldValueInHover, getShowOver, getShowOverIcons, getShowPending, getShowPickerIcon, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStaticHeight, getStopOnError, getSupportsCutPasteEvents, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextFormula, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getUpdateControlOnOver, getUpdatePickerIconOnOver, getUpdateTextBoxOnOver, getUseDisabledHintStyleForReadOnly, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsRecordList, getValueDeselectedCSSText, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleTitleWidth, getVisibleWhen, getVisibleWidth, getWarnOnEditorTypeConversion, getWarnOnEditorTypeConversionDefault, getWidth, getWidthAsString, getWrapHintText, getWrapTitle, handleWarnOnEditorTypeConversion, hasAdvancedCriteria, hasErrors, hide, hideIcon, invalidateDisplayValueCache, isCreated, isCutEvent, isDisabled, isDrawn, isFocused, isInGrid, isPasteEvent, isVisible, linkToInstanceUponCreate, mapDisplayToValue, mapValueToDisplay, mapValueToDisplay, mapValueToDisplay, redraw, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoComplete, setBrowserInputType, setBrowserSpellCheck, setCanEdit, setCanEditCriterionPredicate, setCanEditOpaqueValues, setCanFocus, setCanTabToIcons, setCellHeight, setCellStyle, setChangeOnKeypress, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setControlStyle, setCriteriaField, setCriterion, setCriterionGetter, setCriterionSetter, setCustomStateGetter, setDataPath, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultProperties, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorProperties, setEditorType, setEditorType, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setErrors, setErrors, setExportFormat, setFetchMissingValues, setFilterLocally, setForeignDisplayField, setFormat, setFormula, setGlobalTabIndex, setHeight, setHeight, setHidden, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconDisabled, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconWidth, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setJavaScriptObject, setLeft, setLoadingDisplayValue, setLocateItemBy, setMinHintWidth, setMultipleValueSeparator, setName, setNullProperty, setOperator, setOptionCriteria, setOptionDataSource, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setOriginalValueMessage, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPickerIconSrc, setPickerIconStyle, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyHover, setReadOnlyTextBoxStyle, setReadOnlyWhen, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRequiredWhen, setRowSpan, setSaveOnEnter, setScClassName, setSelectOnClick, setSelectOnFocus, setShouldSaveValue, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDeletions, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOldValueInHover, setShowOver, setShowOverIcons, setShowPending, setShowPickerIcon, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStateCustomizer, setStaticHeight, setStopOnError, setSupportsCutPasteEvents, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextFormula, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setUpdateControlOnOver, setUpdatePickerIconOnOver, setUpdateTextBoxOnOver, setUseDisabledHintStyleForReadOnly, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueDeselectedCSSText, setValueField, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setVisibleWhen, setWarnOnEditorTypeConversion, setWarnOnEditorTypeConversionDefault, setWidth, setWidth, setWrapHintText, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, showPicker, stopHover, storeValue, storeValue, updateState, validate, valueClipped`

    - ### Methods inherited from class com.smartgwt.client.core.RefDataClass

      `getRef, getRef, internalSetID`

    - ### Methods inherited from class com.smartgwt.client.core.DataClass

      `applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getReadOnly, isFactoryCreated, logConfiguration, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated, setReadOnly`

    - ### Methods inherited from class com.smartgwt.client.core.JsObject

      `equals, getJsObj, hashCode, setJsObj`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.google.gwt.event.shared.HasHandlers

      `fireEvent`

- - ### Constructor Detail

    - #### LinkItem

          public LinkItem()

    - #### LinkItem

          public LinkItem(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### LinkItem

          public LinkItem(java.lang.String name)

  - ### Method Detail

    - #### getOrCreateRef

          public static LinkItem getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### changeAutoChildDefaults

          public static void changeAutoChildDefaults(java.lang.String autoChildName,
                                                     Canvas defaults)

      Changes the defaults for Canvas AutoChildren named `autoChildName`.
      Parameters:
        `autoChildName` - name of an AutoChild to customize the defaults for.
        `defaults` - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see `SGWTProperties`.
      See Also:
        `AutoChildUsage`

    - #### changeAutoChildDefaults

          public static void changeAutoChildDefaults(java.lang.String autoChildName,
                                                     FormItem defaults)

      Changes the defaults for FormItem AutoChildren named `autoChildName`.
      Parameters:
        `autoChildName` - name of an AutoChild to customize the defaults for.
        `defaults` - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see `SGWTProperties`.
      See Also:
        `AutoChildUsage`

    - #### changePickerIconDefaults

          public static void changePickerIconDefaults(FormItemIcon defaults)

    - #### setDisableIconsOnReadOnly

          public void setDisableIconsOnReadOnly(java.lang.Boolean disableIconsOnReadOnly)

      If `FormItem.canEdit` is set to false, should `icons` be disabled by default?

      This may also be specified at the icon level. See `FormItemIcon.disableOnReadOnly`.

      Overrides:
        `setDisableIconsOnReadOnly` in class `FormItem`
      Parameters:
        `disableIconsOnReadOnly` - Default value is false

    - #### getDisableIconsOnReadOnly

          public java.lang.Boolean getDisableIconsOnReadOnly()

      If `FormItem.canEdit` is set to false, should `icons` be disabled by default?

      This may also be specified at the icon level. See `FormItemIcon.disableOnReadOnly`.

      Overrides:
        `getDisableIconsOnReadOnly` in class `FormItem`
      Returns:
        Boolean

    - #### setIconVAlign

          public void setIconVAlign(VerticalAlignment iconVAlign)

      How should icons be aligned vertically for this form item.

      Note : This is an advanced setting

      Overrides:
        `setIconVAlign` in class `FormItem`
      Parameters:
        `iconVAlign` - Default value is "center"

    - #### getIconVAlign

          public VerticalAlignment getIconVAlign()

      How should icons be aligned vertically for this form item.
      Overrides:
        `getIconVAlign` in class `FormItem`
      Returns:
        VerticalAlignment

    - #### setLinkTitle

          public void setLinkTitle(java.lang.String linkTitle)

      Optional title HTML to display for this item's link. If unset, the `LinkItem`'s value (the URL) will be used for the link's title.
      If this method is called after the component has been drawn/initialized: Setter for `linkTitle`.
      Parameters:
        `linkTitle` - new `linkTitle` HTML.
      See Also:
        `HTMLString . Default value is null`

    - #### getLinkTitle

          public java.lang.String getLinkTitle()

      Optional title HTML to display for this item's link. If unset, the `LinkItem`'s value (the URL) will be used for the link's title.
      Returns:
      See Also:
        `HTMLString`

    - #### setReadOnlyDisplay

          public void setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)

      If `canEdit` is set to `false`, how should this `LinkItem` be displayed to the user?

      Link items are, by default, canEdit:false. Note that the link remains active regardless of the `readOnlyDisplay` setting.

      Overrides:
        `setReadOnlyDisplay` in class `FormItem`
      Parameters:
        `readOnlyDisplay` - Default value is null
      See Also:
        `DynamicForm.setReadOnlyDisplay(com.smartgwt.client.types.ReadOnlyDisplayAppearance)`

    - #### getReadOnlyDisplay

          public ReadOnlyDisplayAppearance getReadOnlyDisplay()

      If `canEdit` is set to `false`, how should this `LinkItem` be displayed to the user?

      Link items are, by default, canEdit:false. Note that the link remains active regardless of the `readOnlyDisplay` setting.

      Overrides:
        `getReadOnlyDisplay` in class `FormItem`
      Returns:
        ReadOnlyDisplayAppearance
      See Also:
        `DynamicForm.getReadOnlyDisplay()`

    - #### setTarget

          public void setTarget(java.lang.String target)

      By default, clicking a link rendered by this item opens it in a new browser window. You can alter this behavior by setting this property. The value of this property will be passed as the value to the `target` attribute of the anchor tag used to render the link.

      If you set linkItem.target to "javascript", the default behaviour is to catch and consume mouse-clicks that would result in the link being followed. Instead, the `FormItem.click()` event is fired.

      Parameters:
        `target` - Default value is "_blank"

    - #### getTarget

          public java.lang.String getTarget()

      By default, clicking a link rendered by this item opens it in a new browser window. You can alter this behavior by setting this property. The value of this property will be passed as the value to the `target` attribute of the anchor tag used to render the link.

      If you set linkItem.target to "javascript", the default behaviour is to catch and consume mouse-clicks that would result in the link being followed. Instead, the `FormItem.click()` event is fired.

      Returns:
        String

    - #### setDefaultProperties

          public static void setDefaultProperties(LinkItem linkItemProperties)

      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
        `linkItemProperties` - properties that should be used as new defaults when instances of this class are created
      See Also:
        `SGWTProperties`

    - #### addClickHandler

          public com.google.gwt.event.shared.HandlerRegistration addClickHandler(ClickHandler handler)

      Description copied from class: `FormItem`
      Add a click handler.

      Called when this FormItem is clicked on.

      Note: `click()` is available on StaticTextItem, BlurbItems, ButtonItem, and derivatives. Other form items (such as HiddenItem) do not support `click()`.

      Specified by:
        `addClickHandler` in interface `HasClickHandlers`
      Overrides:
        `addClickHandler` in class `FormItem`
      Parameters:
        `handler` - the click handler
      Returns:
        `HandlerRegistration` used to remove this handler