Hi,
I am trying to create certain actions for a custom object of ours
<extension id="com.foo.actionSet">
<extendedPoint>vise.actions.sets</extendedPoint>
<object>
<actions>
<!-- Create my custom object -->
<com.vmware.actionsfw.ActionSpec>
<uid>com.foo.createCustomObject</uid>
<label>CREATE_ACTION_LABEL</label>
<icon>#{myAddIcon.icon}</icon>
<conditionalProperty>ShowActions</conditionalProperty>
<command className="com.foo.CustomObjectActionCommand"/>
</com.vmware.actionsfw.ActionSpec>
<!-- Delete my custom object-->
<com.vmware.actionsfw.ActionSpec>
<uid>com.foo.deleteCustomObject</uid>
<label>DELETE_ACTION_LABEL</label>
<icon>#{myDeleteIcon.icon}</icon>
<command className="com.foo.CustomObjectActionCommand"/>
</com.vmware.actionsfw.ActionSpec>
</actions>
</object>
<metadata>
<objectType>ns:CustomObject</objectType>
</metadata>
</extension>
I am having trouble understanding how this conditionalProperty can be put to use => Imagine a situation where there are no custom objects and I am in the object collection view for my custom object => How does the conditionalProperty get its value as there is no instance to work with?
I basically want to disable the above actions under the "Related Objects" view (i.e coming in from some random object that is related to my custom object) but enable it in the global collection view for my custom object. I added a new property called "ShowActions" on my CustomObject and I can see the adaptor property query calls landing on it. But my issue is I do not have the global view information that I need to determine if I should show my actions. Is there a way to find out which global context object view that triggered this? i.e. if my custom object is related to a VM and I click on VCenter => Virtual Machines => select a particular VM => Click on related objects to show my custom objects that are related to the VM => Disable the actions that were tied to my custom object. In this scenario, please do consider what would happen to the actions if no related custom objects were found and there is no instance to read the property off of.
Any help is appreciated.
Thank you.