Quantcast
Channel: VMware Communities : Discussion List - vSphere Client SDK
Viewing all articles
Browse latest Browse all 2218

Action sets with conditionalProperty or filters

$
0
0



I am trying to setup my action set tool bar that appears above my table to list/table of my custom inventory objects to have entries that are enabled under only certain conditions.  The commands are for things like creating a new entry, so they are not associated with a specific object instance.  The problem is that my action set/menu bar is always disabled even when it should be enabled because the condition should be met.


I have been trying to use the <conditionalProperty> element to specify a property to be used for enabling the menu/action items.  Unfortunately it doesn't seem to be working for me.  I do have my data adapter for my object type handling the property being used for the conditionalProperty and in other areas of my plugin where I use it, I do see it being invoked.  I am thinking that this may be due to the fact that since the menu isn't connected to a specifically selected object, the conditional property isn't going to my data adapter.  I am  starting to thing that this is probably because the menu is not tied to a specific object instance.  


So my question is how can I use <conidtionalProperty> or  <propertyConditions> to accomplish what I am trying to do?


Below is an example of what I am trying to do:


  <extension id="com.mycompany.vcenterWebClientui.myObject.listActionSet">



      <extendedPoint>vise.actions.sets</extendedPoint>



      <object>



         <actions>



            <com.vmware.actionsfw.ActionSpec>



               <uid>com.mycompany.vcenterWebClientui.myObject.createMyObject</uid>



          <label>#{myObject.createAction}</label> 


                    &lt;icon&gt;#&lt;/icon&gt;


               <acceptsMultipleTargets>false</acceptsMultipleTargets>



               <conditionalProperty>adminWritePriv</conditionalProperty> 



               <delegate>



                  <className>com.vmware.vsphere.client.htmlbridge.HtmlActionDelegate</className>



                  <object><root>



                     <!-- execute the action on client-side (html view in a modal dialog) -->



                     <actionUrl>/vsphere-client/vcenterWebClient-ui/resources/createMyObject.html</actionUrl>



                     <dialogTitle>#{myObject.createAction}</dialogTitle>



                     <dialogSize>500,300</dialogSize>



                  </root></object>



               </delegate>



               <!-- All context-less actions should be marked as private to prevent them



                  from showing up in all menus.-->



               <privateAction>true</privateAction>



            </com.vmware.actionsfw.ActionSpec>



         </actions>



      </object>



      <metadata>



      </metadata>



    </extension>



   <extension id="com.mycompany.vcenterWebClientui.myObject.listAction">



      <extendedPoint>vmware.prioritization.listActions</extendedPoint>



      <object>



         <prioritizedIds>



            <String>com.mycompany.vcenterWebClientui.myObject.createMyObject</String>



         </prioritizedIds>



         <regionId>com.mycompany.vcenterWebClientui.myObject.list</regionId>



      </object>



   </extension>



I have also tried setting up propertyConditions along the lines of what is shown below with no success.  I have tried it with and with out having an <objectType> tag.   I believe I have the code in place in my service to handle the fetchign of the adminWritePriv and have seen it be invoked in other parts of my plugin successfully.




   <propertyConditions>



      <com.vmware.data.query.CompositeConstraint>



        <nestedConstraints>



          <com.vmware.data.query.PropertyConstraint>



            <propertyName>adminWritePriv</propertyName>



               <comparator>EQUALS</comparator>



               <comparableValue>



                 <Boolean>true</Boolean>



               </comparableValue>



          </com.vmware.data.query.PropertyConstraint>



        </nestedConstraints>



      </com.vmware.data.query.CompositeConstraint>



   </propertyConditions>




Viewing all articles
Browse latest Browse all 2218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>