VMware {code} Community
erikDoesStorage
Enthusiast
Enthusiast

Supplying data for custom columns added to a vsphere object's table



I am working on adding some custom columns to the datastore table in my HTML Bridge based plugin.  I have added the following to my plugin.xml file:


   <extension id="com.mycompany.vcenterWebClientui.datastore.list.myNiceColumns">



      <extendedPoint>vsphere.core.datastore.list.columns</extendedPoint>



      <object>



         <items>



            <com.vmware.ui.lists.ColumnContainer>



               <uid>com.mycompany.vcenterWebClientui.datastore.column.myCustomName</uid>



               <dataInfo>



                  <com.vmware.ui.lists.ColumnDataSourceInfo>



            <headerText>#{datastore.column.myCustomName}</headerText> 



                     <requestedProperties>



                        <String>myCustomName</String>



                     </requestedProperties>



                     <sortProperty>myCustomName</sortProperty>



                     <exportProperty>myCustomName</exportProperty>



                  </com.vmware.ui.lists.ColumnDataSourceInfo>



               </dataInfo>



            </com.vmware.ui.lists.ColumnContainer>



         </items>



      </object>



   </extension>



The result is that my column does appear as expected in the datastore table.



But I don't understand how I am to feed the appropriate data to the column.  I don't see my data adapter class being called.  




I tried adding Datastore to the annotation @type("Datastore,myDataType") of my DataProviderAdapter but that doesn't seem to result in it being invoked to get data for the column.



I looked at the documentation and also the chassisRackVSphere example, but I haven't spotted the solution in any of those.




My question is how do I tie that column I have added to my DataProviderAdapter (or another service side class) to supply the data for the column?  


0 Kudos
5 Replies
laurentsd
VMware Employee
VMware Employee

> I tried adding Datastore to the annotation @type("Datastore,myDataType") of my DataProviderAdapter but that doesn't seem to result in it being invoked to get data for the column.

This is the proper way to declare the type Datastore in your data adapter.  Is it called for any query related to Datastore?

0 Kudos
erikDoesStorage
Enthusiast
Enthusiast



I did not see it getting called when I tried it.  I didn't see my printouts occur nor did I see my break point be hit.

0 Kudos
laurentsd
VMware Employee
VMware Employee

Try adding Datastore to the chassis sample's data adapter and you should see getData() being called each time some datastore is displayed on the screen.

0 Kudos
erikDoesStorage
Enthusiast
Enthusiast



This time it worked.  I don't know why the same thing didn't appear to work for me before, perhaps a subtle typo or sometimes the Eclipse development environment gets wonky with some extraneous Java zombie processes interfering with things.  


At any point, now having the Datastore listed in the @type annotation for my adapter is working.   

0 Kudos
abhishekdubey
Enthusiast
Enthusiast

Hi erikDoesStorageerikDoesStorage,

I am also facing the similar issue where i am trying to add additional column to VirtualMachine.

I am able to display the column to UI and able to get control in getData(.. Method.

 

However i am not able to get the selected object references from the query spec.

https://communities.vmware.com/create-advanced-comment.jspa?id=2615187&draftID=264401

Can you please let me know how u get the query parsed so that u get the Object reference of respective datastore for which u returned some response to UI.

That will be very helpfull.

regards,

Abhishek@@

0 Kudos