Class NmActionDataUtility

java.lang.Object
com.ptc.core.components.factory.AbstractDataUtility
com.ptc.core.components.factory.dataUtilities.NmActionDataUtility
All Implemented Interfaces:
DataUtility

public class NmActionDataUtility extends AbstractDataUtility
Gets an NmHTMLActionModel or NmAction for a given column descriptor. By default this data utility will return the Actions hyperlink. And by default the Actions hyperlink will display the action model flagged with menufor="<someObjectType>" in an actionmodels.xml file, where someObjectType is the type of the row object (e.g. wt.part.WTPart) This is determined dynamically, you should not have to configure it, even if your table has multiple object types.

To have this data utility return an Actions hyperlink to some other action model use the "actionModel" property. In a builder it would be like:
    ColumnConfig col = factory.newColumnConfig(DescriptorConstants.ColumnIdentifiers.NM_ACTIONS,false);
    col.setActionModel(<action_model_name>);
    tableConfig.addComponent(col);
or from a data utility sub class it would be like:
    descriptor.setProperty(DescriptorConstants.ActionProperties.ACTION_MODEL, "<action_model_name>");
Where <action_model_name> is the name of some action model in an actionmodels.xml.

Its preferred to put actions in the actions menu rather than displaying them as action icons. But it is possible to have this data utility return an NmAction that would display as an action icon. To do this create a subclass, override setModelData() and set the objectType and actionName properties on the descriptor. For example:
    descriptor.setProperty(DescriptorConstants.ActionProperties.ACTION_NAME, "<action_name>");
    descriptor.setProperty(DescriptorConstants.ActionProperties.OBJECT_TYPE, "<object_type>");
Where <action_name> and <object_type> are the name and type of an action specified in an actions.xml file.

Supported API: true

Extendable: true

  • Method Details

    • getDataValue

      public Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException
      For detailed description check DataUtility#getDataValue(String, Object, ModelContext)

      Supported API: true

      Extendable: true
      Parameters:
      component_id - The id to build a view object for
      datum - The object to extract model data from
      mc - The context in which the component model data is being extracted
      Returns:
      An object that can be sent to a view for rendering
      Throws:
      WTException - If a problem occurs while extracting the data