• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

4-argument observer functions have problems?

LEGEND ,
Jun 22, 2010 Jun 22, 2010

Copy link to clipboard

Copied

The 4-argument form of observer functions passed to observableTable:addObserver appears to be buggy when used with popup menus.  After a small number of invocations of the menu, the observer function will stop getting called.  I'll report this as a bug soon unless someone points out any misunderstanding I may have.

Here's a short test program that illustrates the behavior:

local LrBinding = import 'LrBinding'
local LrDialogs = import 'LrDialogs'
local LrFunctionContext = import 'LrFunctionContext'
local LrView = import 'LrView'

LrFunctionContext.callWithContext ("Test", function (context)
  LrDialogs.attachErrorDialogToFunctionContext (context)
  local f = LrView.osFactory()
  local p = LrBinding.makePropertyTable (context)
  p:addObserver ("m3", function (p, k, v) p.e3 = v end)
  p:addObserver ("m4", {}, function (t, p, k, v) p.e4 = v end)
  LrDialogs.presentModalDialog {title = "Test",
    contents = f:column {bind_to_object = p,
      f:row {f:static_text {title = "3-arg observer: "},
             f:popup_menu {value = LrView.bind ("m3"),
                           items = {"A", "B"}},
             f:edit_field {value = LrView.bind ("e3")}},
      f:row {f:static_text {title = "4-arg observer: "},
             f:popup_menu {value = LrView.bind ("m4"),
                           items = {"A", "B"}},
             f:edit_field {value = LrView.bind ("e4")}}}}
  end)

You can invoke the menu "3-arg observer" as many times as you want, and its observer will continue to be called (which updates its edit field). But after invoking the menu "4-arg observer" 10 to 20 times, the observer stops getting called. (In my actual plugin, this would happen after invoking the menu just a couple of times.)

The problem occurs with my larger catalog (16K photos) but not with a small test catalog.

TOPICS
SDK

Views

689

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 25, 2010 Jun 25, 2010

Copy link to clipboard

Copied

LATEST

I reported this as a bug via the Web form.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines