<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Validation within SaveItemDialog in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1280231#M9716</link>
    <description>&lt;P&gt;You are correct as&amp;nbsp;&lt;SPAN&gt;SaveItemDialog doesn't validate the path at all.&amp;nbsp; &amp;nbsp;I guess the designers of&amp;nbsp;SaveItemDialog allowed for invalid paths to be entered assuming the caller would verify the validity.&amp;nbsp; I tried this in ArcGIS Pro trying to save a layer by entering a path that doesn't exist:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1681916931026.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68413i1BA587C943921738/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1681916931026.png" alt="Wolf_0-1681916931026.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After i clicked save i get this message in Pro:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1681917058292.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68414i2FD41E09F64860D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1681917058292.png" alt="Wolf_1-1681917058292.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i guess it's conceivable that the calling business logic could attempt to create the path if it doesn't exist.&lt;/P&gt;&lt;P&gt;However, in ArcGIS Pro after the error is displayed, the caller immediately pops up the SaveItemDialog again with the 'bad path entry' using the bad path as the initial location:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_4-1681917505902.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68417iF15381C6540F62BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_4-1681917505902.png" alt="Wolf_4-1681917505902.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2023 15:19:59 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2023-04-19T15:19:59Z</dc:date>
    <item>
      <title>Validation within SaveItemDialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1278263#M9662</link>
      <description>&lt;P&gt;Is there a way to validate the value that is in the name textbox on the SaveItemDialog when the Save button is clicked? Say for example the user typed a path into the textbox where the directory component did not exist on disc.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:10:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1278263#M9662</guid>
      <dc:creator>StevenCorpus</dc:creator>
      <dc:date>2023-04-13T14:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Validation within SaveItemDialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1278423#M9671</link>
      <description>&lt;P&gt;The validation is working for me.&amp;nbsp; You can specify the BrowseFilter / Filter properties to further restrict the input options.&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9002.html" target="_blank"&gt;SaveItemDialog Class—ArcGIS Pro&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1278423#M9671</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-04-13T17:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Validation within SaveItemDialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1278476#M9674</link>
      <description>&lt;P&gt;code example&lt;/P&gt;&lt;P&gt;var dlg = new SaveItemDialog();&lt;BR /&gt;dlg.Title = "title";&lt;BR /&gt;dlg.OverwritePrompt = true;&lt;BR /&gt;dlg.DefaultExt = "gmcx";&lt;BR /&gt;dlg.InitialLocation = @"C:\Temp";&lt;/P&gt;&lt;P&gt;var fileFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_browseFiles");&lt;BR /&gt;fileFilter.FileExtension = "gmcx";//restrict to specific extensions as needed&lt;BR /&gt;fileFilter.BrowsingFilesMode = false;&lt;/P&gt;&lt;P&gt;//Specify a name to show in the filter dropdown combo box - otherwise the name&lt;BR /&gt;//will show as "Default"&lt;BR /&gt;fileFilter.Name = "(*.gmcx)";&lt;BR /&gt;dlg.BrowseFilter = fileFilter;&lt;/P&gt;&lt;P&gt;bool? saveFile = dlg.ShowDialog();&lt;/P&gt;&lt;P&gt;if (saveFile == true)&lt;BR /&gt;{&lt;BR /&gt;NewCatalogPath = dlg.FilePath;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I have a custom Item with a .gmcx extension, and I have created a BrowseProjectFilter to limit&lt;BR /&gt;the browsing to files with .gmcx extensions.&lt;/P&gt;&lt;P&gt;The issue I would like to fix if possible is that the user can type into the Name textbox, enter a&lt;BR /&gt;path using a directory that doesn't exist and yet the Save button is available and FilePath returned&lt;BR /&gt;is using a non-existant directory.&lt;/P&gt;&lt;P&gt;See the attached image as an example. The user can enter c:\directoryThatDoesNotExist\newgmcx and&lt;BR /&gt;clicking the Save button returns a dlg.FilePath of c:\directoryThatDoesNotExist\newgmcx.gmcx&lt;/P&gt;&lt;P&gt;Is there a way to have the dialog validate that everything left of newgmcx actually exists before&lt;BR /&gt;saveFile == true?&lt;/P&gt;&lt;P&gt;When this was tried using microsoft's SaveFileDialog, a warning is given and the workflow stopped.&lt;BR /&gt;See second attachment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 18:58:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1278476#M9674</guid>
      <dc:creator>StevenCorpus</dc:creator>
      <dc:date>2023-04-13T18:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Validation within SaveItemDialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1280231#M9716</link>
      <description>&lt;P&gt;You are correct as&amp;nbsp;&lt;SPAN&gt;SaveItemDialog doesn't validate the path at all.&amp;nbsp; &amp;nbsp;I guess the designers of&amp;nbsp;SaveItemDialog allowed for invalid paths to be entered assuming the caller would verify the validity.&amp;nbsp; I tried this in ArcGIS Pro trying to save a layer by entering a path that doesn't exist:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1681916931026.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68413i1BA587C943921738/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1681916931026.png" alt="Wolf_0-1681916931026.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After i clicked save i get this message in Pro:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1681917058292.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68414i2FD41E09F64860D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1681917058292.png" alt="Wolf_1-1681917058292.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i guess it's conceivable that the calling business logic could attempt to create the path if it doesn't exist.&lt;/P&gt;&lt;P&gt;However, in ArcGIS Pro after the error is displayed, the caller immediately pops up the SaveItemDialog again with the 'bad path entry' using the bad path as the initial location:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_4-1681917505902.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68417iF15381C6540F62BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_4-1681917505902.png" alt="Wolf_4-1681917505902.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 15:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1280231#M9716</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-04-19T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Validation within SaveItemDialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1280235#M9717</link>
      <description>Thanks for verifying this for me. I have made workarounds in my code. I just wanted to be sure that this was necessary.&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Apr 2023 15:24:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/validation-within-saveitemdialog/m-p/1280235#M9717</guid>
      <dc:creator>StevenCorpus</dc:creator>
      <dc:date>2023-04-19T15:24:58Z</dc:date>
    </item>
  </channel>
</rss>

