Lightroom SDK: LrFtp.makeFtpPresetPopup bind_to_object must be set.

  • 1
  • Problem
  • Updated 6 years ago
I just figured out one of the (many) problems I've had using FTP preset popups is due to the (undocumented) requirement to set bind_to_object. If not set, presets can not be edited. I thought, since properties is being passed explicitly, it would serve as the bind-to object - I thought wrong. Perhaps some better documentation is in order. For example:

local ftpPresetPopup = LrFtp.makeFtpPresetPopup {
factory = vf,
properties = props,
-- bind_to_object = props, - commented out.
valueBinding = 'ftpSettingsBuf', -- for internal use only - hardcoding should be fine.
itemsBinding = 'ftpItems', -- not sure how this works anyway... ###4
width_in_chars = 30; -- determines data-1 width.
width = share '_data_1',
tooltip = "FTP Presets - select or edit..., but remember to click 'Use Preset' afterward.",
enabled = enabledBinding,
}
Can't edit presets - "Edit..." is just displayed as popup menu selection instead, and nothing else happens.

local ftpPresetPopup = LrFtp.makeFtpPresetPopup {
factory = vf,
properties = props,
bind_to_object = props, -- uncommented
valueBinding = 'ftpSettingsBuf', -- for internal use only - hardcoding should be fine.
itemsBinding = 'ftpItems', -- not sure how this works anyway... ###4
width_in_chars = 30; -- determines data-1 width.
width = share '_data_1',
tooltip = "FTP Presets - select or edit..., but remember to click 'Use Preset' afterward.",
enabled = enabledBinding,
}
Now *can* edit presets as expected...

Reminder: valuesBinding vs. itemsBinding also warrants some explanation: documentation says tables are required, but I've never been able to use a table successfully, and pass strings instead, but then I've been having problems in this regard, so maybe I just haven't been passing the *right* table???

PS - I've asked about this in the SDK forum too, but no response there...
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes

Posted 6 years ago

  • 1

Be the first to post a reply!