Skip to main content
Inspiring
February 9, 2025
Answered

Dynamic view with LRC SDK in Lua

  • February 9, 2025
  • 1 reply
  • 300 views

Hi,

 

I'm currently doing further development of a Lightroom Classic plugin written in Lua. In the GUI part of it, I need to change parts of the view depending on the current configuration. To be specific I need an amount of f:edit_field() that is not fixed. Anyone got an idea, how this possible. I saw the example in the SDK manual on page 114, but this doesn't feed my needs.

 

I tried for testing:

     local dialogView = f:row {
        bind_to_object = propertyTable,
        f:group_box {
            title = LOC "$$$/lrc-ai-assistant/ResponseStructure/ConfigureResponseStructure=Keywords",
            f:edit_field {
                value = bind 'keywordCategories'
            },
        },
    }

    table.insert(dialogView, f:row {
            bind_to_object = propertyTable,
            f:group_box {
                title = LOC "$$$/lrc-ai-assistant/ResponseStructure/ConfigureResponseStructure=Keywords",
                f:static_text {
                    title = Defaults.defaultKeywordCategories,
                },
            },
        }
    )

local result = LrDialogs.presentModalDialog({
        title = LOC "$$$/lrc-ai-assistant/ResponseStructure/ConfigureResponseStructure=Configure data generation and mapping",
        contents = dialogView,
    })

 

But the part inserted with table.insert doesn't show up. Anybody got an idea, what I'm doing wrong here?

 

Many thanks in advance

Bastian

1 reply

basti.machekAuthorCorrect answer
Inspiring
February 9, 2025