How to change the caption of my tab and group through MainModule?

476
5
12-13-2023 07:34 AM
AtilaBK
New Contributor II

I am changing my Caption from my buttons by the MainModule class using "FrameworkApplication.GetPlugInWrapper" and it seems to work well, but when I try to change the Caption from my tab or group, the update seems not to work, can someone help?

var tab = FrameworkApplication.GetPlugInWrapper("ID_MyTab", false);
tab.Caption = "new caption tab";

var grupo = FrameworkApplication.GetPlugInWrapper("ID_MyGrou", false);
grupo.Caption = "new caption group";

0 Kudos
5 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

You can change tab or group names directly in daml. Tabs and groups have "caption" attribute.

What is the reason to change them from code?

 

<tabs>
<tab id="ApplySymbology_Tab1" caption="New Tab">
          <group refID="ApplySymbology_Group1"/>
        </tab>
</tabs>
<groups>
    <group id="ApplySymbology_Group1" caption="Group 1" appearsOnAddInTab="true" keytip="G1">
      <button refID="ApplySymbology_ApplySymbButton" size="large" /> 
    </group>
</groups>

  

AtilaBK
New Contributor II

Hi, the name has to be defined by api response, which I only have in the end of the Initialize (mainModule).

In this case, the "labels" are defined in the database and I access this db by API.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Have you tried to pass "true" for second parameter in FrameworkApplication.GetPlugInWrapper?

On startup your tab or group could be not created.

0 Kudos
AtilaBK
New Contributor II

Yes, I try with and without the last parameter true, but both don't work. What I find strange is that it works for button and gallery.

0 Kudos
GKmieliauskas
Esri Regular Contributor

On ArcGIS Pro 3.1 renaming of Group is working fine. I rename it in module overridden Initialize() method.

I have found that FrameworkApplication.GetPlugInWrapper method in both cases returns invalid CommandType property. It returns Button, but it must return Tab and Group

CommandType Enumeration—ArcGIS Pro

 

0 Kudos