Hi,
I have a binding problem in my LrPluginInfoProvider.sectionsForBottomOfDialog function, and i cannot make it work; i've read all the docs, view all the samples, but i just can´t see where the problem is ...
I have this code in my Info.lua
return {
...
LrPluginInfoProvider = 'PluginInfoProvider.lua',
...
}
PluginInfoProvider.lua has this code:
require 'PluginManager'
return {
sectionsForBottomOfDialog = PluginManager.sectionsForBottomOfDialog,
}
And this is PluginManager.lua:
local LrView = import 'LrView'
local LrDialogs = import 'LrDialogs'
local LrLogger = import 'LrLogger'
local myLogger = LrLogger('logger')
myLogger:enable("logfile")
PluginManager = {}
function PluginManager.sectionsForBottomOfDialog(viewFactory, propertyTable)
propertyTable.text = ""
propertyTable.buttonEnabled = false
return {
{
title = "Test",
viewFactory:row {
spacing = viewFactory:control_spacing(),
viewFactory:static_text {
title = LOC "Text",
},
viewFactory:edit_field {
value = LrView.bind "text",
validate = function( view, value )
if #value > 0 then -- check length of entered text
propertyTable.buttonEnabled = true
else
propertyTable.buttonEnabled = false
end
return true, value
end,
},
viewFactory:push_button {
enabled = LrView.bind 'buttonEnabled',
action = function(button)
myLogger:trace("Test value")
myLogger:trace(propertyTable.text)
end,
},
}
},
}
end
As far as i know, the button should enable only when there is some info in the text field and log file should show the text field value, but it only displays "Test value" and the button is always enabled.
Any idea? i'm really with this ... (i don't know if matters, but i'm testing this in a WinXP machine with LR 2.3)
Thanks in advance,