5 Replies Latest reply on Aug 11, 2010 4:48 PM by cmanhard

    FindAttributes and SystemPicker, DatabasePicker

    wxz44428

      I am trying to implement the functionality that when user clicks a button, an attribute find dialog will be shown. Browsing through the API, it seems the existing UI of AFOperations.FindAttributes would provide that dialog nicely, except one thing: in that out-of-box 'Attribute Search' dialog, there is the systempicker and database picker, that are somewhat modifiable--e.g., the 'list' button is available for System picker there, and end user can do a lot of changes to it, like changing Timeout etc. Is there a way we can through the API to lock down the existing SystemPicker and DatabasePicker (e.g., disable them) in the existing 'Attribute Search' dialog ? The goal is, end user is only doing readonly attribute search, (the PISystem/Db connection and specification is done somewhere else, and AFDatabase info is passed into the AFOperation.FindAttribute call, no update to the PISystem should be allowed in this 'Attribute search' dialog.)

       

      My AFServer service is set up under networkservice account. I am using c#, and with AF 2.1

       

      Thanks a lot.

        • Re: FindAttributes and SystemPicker, DatabasePicker
          cmanhard

          You need to invoke the attribute dialog directly to do this:

           

                  attributes = new AFNamedCollectionList<AFAttribute>();
                  DialogResult dr = DialogResult.Cancel;
                  AttributeSearchDialog dlg = null;
                  try
                  {
                      dlg = new AttributeSearchDialog();
                      if (database != null) dlg.Database = database;
                      dlg.MultiSelect = multiSelect;
                      dlg.EnablePISystem = = false;
                      dlg.EnableDatabase = false;
                      dlg.ReturnEntireQuery = false;
                      dr = dlg.ShowDialog(window);
                      if (dr == DialogResult.OK)
                      {
                          attributes = dlg.Attributes;
                      }
                  }
                  catch (Exception ex)
                  {
                      MessageBox.ShowMessage(ex.Message);
                  }
                  finally
                  {
                      if (dlg != null)
                      {
                          dlg.Dispose();
                          dlg = null;
                      }
                  }

            • Re: FindAttributes and SystemPicker, DatabasePicker
              wxz44428

              Thanks a lot for the quick answer. That works great.

               

              A related issue, I am facing the similar issue when implementing selecting PISystem and Database. I want user to be able to enter connection details to PISystem, by entering host name, port, uid, password eg., to try to connect to that system directly. And also allow him to browse the list of existing PISystems, and viewing the connection details, and connect to one of the existing PISystems that way. Once PISystem is selected, then allow him to view the list of avaialbe databases, and pick one. I was trying to use PISystemPicker, AFDatabasePicker, or the existing DatabaseSearchDialog. It works in a way, however, all the above 3 UIs will allow the user to make changes to the existing system in someway (e.g, they can change description, change timeout, delete something). I've tried various Enablexxx, Readonly, IsSecurityReadonly properties etc., but it still allow user to make various changes. There seems no way to use the existing AF controls to realize the connect to PISystem/databas in a somewhat viewonly mode. Any help would be much appreciated.