Which DAML ID must be used for adding a button to the layer/standalone context menu like "Attribute Table" is doing?

617
1
Jump to solution
07-08-2021 03:52 AM
GEOINT_ENGINEER
Esri Contributor

We need to add a custom button to the context menu for feature layers. In the past we used esri_mapping_layerContextMenu and esri_mapping_standaloneTableContextMenu.

We define the state as insert conditions for layers and standalone tables by using:

  • <state id="esri_mapping_singleLayerSelectedCondition"/>
  • <state id="esri_mapping_singleFeatureLayerSelectedCondition"/>
  • <state id="esri_mapping_singleStandaloneTableSelectedCondition"/>

With ArcGIS Pro 2.7 and 2.8 esri_mapping_layerContextMenu seems not to work for any shapefile related layers, any help would be appropriated.

0 Kudos
1 Solution

Accepted Solutions
GEOINT_ENGINEER
Esri Contributor

We finally figured it out, also we have to use singleLayerSelectedCondition instead of singleFeatureLayerSelectedCondition for enabling it.

 

 

<conditions>
    <insertCondition id="esri_mapping_single_layer_selected">
      <and>
        <state id="esri_mapping_singleLayerSelectedCondition"/>
      </and>
    </insertCondition>
    <insertCondition id="esri_mapping_single_standalonetable_selected">
      <and>
        <state id="esri_mapping_singleStandaloneTableSelectedCondition"/>
      </and>
    </insertCondition>
  </conditions>


<updateModule refID="esri_mapping">
      <menus>
        <updateMenu refID="esri_mapping_layerContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false"   placeWith="esri_editing_table_openTablePaneButton" insert="after" />
        </updateMenu>
        <updateMenu refID="esri_mapping_unregisteredLayerContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false"   placeWith="esri_editing_table_openTablePaneButton" insert="after" />
        </updateMenu>
        <updateMenu refID="esri_mapping_standaloneTableContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
        </updateMenu>
        <updateMenu refID="esri_mapping_unregisteredStandaloneTableContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
        </updateMenu>
      </menus>
    </updateModule>

 

Using unregistered context menu did the trick. See Solved: Buttons built by ArcGIS Pro SDK cannot be added to... - Esri Community 

View solution in original post

1 Reply
GEOINT_ENGINEER
Esri Contributor

We finally figured it out, also we have to use singleLayerSelectedCondition instead of singleFeatureLayerSelectedCondition for enabling it.

 

 

<conditions>
    <insertCondition id="esri_mapping_single_layer_selected">
      <and>
        <state id="esri_mapping_singleLayerSelectedCondition"/>
      </and>
    </insertCondition>
    <insertCondition id="esri_mapping_single_standalonetable_selected">
      <and>
        <state id="esri_mapping_singleStandaloneTableSelectedCondition"/>
      </and>
    </insertCondition>
  </conditions>


<updateModule refID="esri_mapping">
      <menus>
        <updateMenu refID="esri_mapping_layerContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false"   placeWith="esri_editing_table_openTablePaneButton" insert="after" />
        </updateMenu>
        <updateMenu refID="esri_mapping_unregisteredLayerContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false"   placeWith="esri_editing_table_openTablePaneButton" insert="after" />
        </updateMenu>
        <updateMenu refID="esri_mapping_standaloneTableContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
        </updateMenu>
        <updateMenu refID="esri_mapping_unregisteredStandaloneTableContextMenu">
          <insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
        </updateMenu>
      </menus>
    </updateModule>

 

Using unregistered context menu did the trick. See Solved: Buttons built by ArcGIS Pro SDK cannot be added to... - Esri Community