Hi,
I'm developing a H5 plugin and try to add a action to the "ACTIONS" dropdown list when user select a host. The issue is when the modal dialog open the actionUrl, it only passes locale, objectId is missing, i pasted the sample definition FYI.
But if i use com.vmware.vsphere.client.htmlbridge.HtmlActionDelegate instead of com.vmware.vsphere.client.HtmlPluginModalAction, it works and passes both locale and objectId.
I reproduced it with both vSphere 6.5U2 and 6.7U1, Is it a defect of com.vmware.vsphere.client.HtmlPluginModalAction ? Tks.
<extendedPoint>vise.actions.sets</extendedPoint>
<object>
<actions>
<com.vmware.actionsfw.ActionSpec>
<uid>testuid</uid>
<label>test</label>
<delegate>
<className>com.vmware.vsphere.client.HtmlPluginModalAction</className>
<object><root>
<actionUrl>/ui/test/index.html?view=test</actionUrl>
<dialogTitle>test</dialogTitle>
<dialogSize>600,130</dialogSize>
</root></object>
</delegate>
</com.vmware.actionsfw.ActionSpec>
</actions>
</object>
<metadata>
<objectType>HostSystem</objectType>
</metadata>
</extension>
Hi,
The "objectId" parameter is removed because we have introduced an API to give you the selected context objects. It is part of the new JS APIs and is available when using "com.vmware.vsphere.client.HtmlPluginModalAction".
You can use "getContextObjects() => any[]" from inside the opened dialog. The result is an array of context objects representing the targets of the invoked action. Each context object is a JavaScript object that contains a field named 'id' which is the id of the corresponding target object.
Best Regards,
Denis
Thanks for the guidance, Denis, it works!