1 Reply Latest reply on Feb 13, 2011 5:45 AM by DawMatt

    propertytable in Plugin info provider

    Peter Hulst

      Can anyone tell me how the propertytable of the plugin info provider is shared with the rest of the plugin?

       

      infoProvider.sectionsForTopOfDialog = function( f, propertyTable )
          propertyTable:addObserver('mySetting', myObserver)

       

          return {

            .. create a radio button that binds its value to 'mySetting'

          }

      }

       

       

      I'm running into two problems with this:

      1. the observer doesn't seem to work, at least for a radio button. My function myObserver never gets called if I change the radio button settings

      2. any value set into propertyTable isn't visible in the propertyTable passed into the exportServiceProvider's startDialog function.

       

      These two issues prevent me from being able to do anything useful with selection elements in the PluginManager. I can't see them in the ExportServiceProvicer class, and I also can't find a way to persist them (ie in the plugin prefs) within the PluginManager dialog.

       

      Am I doing something wrong? does anyone know of a way to use selection elements in the PluginManager and persist them and/or bind to them?

      thanks

      Peter

        • 1. Re: propertytable in Plugin info provider
          DawMatt Level 3

          sfpeter wrote:

           

          Can anyone tell me how the propertytable of the plugin info provider is shared with the rest of the plugin?

          ...

          I'm running into two problems with this:

          1. the observer doesn't seem to work, at least for a radio button. My function myObserver never gets called if I change the radio button settings

          2. any value set into propertyTable isn't visible in the propertyTable passed into the exportServiceProvider's startDialog function.

           

          ... and I also can't find a way to persist them (ie in the plugin prefs) within the PluginManager dialog.

           

           

          Without seeing the code it is hard to comment on issue 1). I'd suggest checking that the bind_to_object has been set correctly in the table being returned by that function, else the radio button and observer may not be pointing at the same property table.

           

          re 2) the property tables passed to the plugin info provider and export service are not the same.  The plugin info provider code should explicitly load the plugin preferences (e.g. local prefs = import 'LrPrefs'.prefsForPlugin() ) and either bind specific UI elements to that preferences property table, or use the endDialog() to explicitly read the property table fields of interest and set the plugin preferences accordingly.

           

          Matt