Skip to main content
areohbee
Legend
July 24, 2011

P: SDK: LrDialogs.presentModalDialog - actionBinding is broken

  • July 24, 2011
  • 6 replies
  • 635 views

LrDialogs.presentModalDialog - actionVerb works fine, but actionBinding is ignored.

for example, if I write:


local args = {}
args.actionVerb = "Test"
args.actionBinding = 'test'
accItems[#accItems + 1] =
vf:push_button {
title = str:fmt( "Doesntmatter" ),
action = function( button )
LrDialogs.stopModalWithResult( button, 'whocares' )
end
}
end
args.contents = vf:column( mainItems ) - main-items not relevant.
args.accessoryView = vf:row( accItems )
args.save_frame = 'testPrompt'


local answer = LrDialogs.presentModalDialog( args )

then click the 'Test' button, the value returned in answer will be 'ok' - I expect it to be 'test'.

Is it broken? or am I using it incorrectly???

This topic has been closed for replies.

6 replies

Adobe Employee
December 9, 2014
We've documented this properly in the current SDK.

Example:


local props = import 'LrBinding'.makePropertyTable( context )


LrDialogs.presentModalDialog {
contents = f:row {
f:static_text {
title = 'text'
}
},
actionBinding = {
enabled = {
bind_to_object = props,
key = 'actionEnabled'
}
}
}
areohbee
areohbeeAuthor
Legend
December 9, 2014
Thanks for the info Paul.

|> "The 'actionBinding' parameter actually gives you access to the button's view binding properties (to allow you to do things like enable or disable the button.)"

That sounds worthwhile, could you supply an example? (and maybe redocument instead of removing?).
Adobe Employee
December 8, 2014
Yes, that documentation is flat out wrong. The 'actionBinding' parameter actually gives you access to the button's view binding properties (to allow you to do things like enable or disable the button.)

This property should be removed from the documentation. Bug filed.
areohbee
areohbeeAuthor
Legend
November 7, 2014
Hi Rory - that was a very nice way to put it - thanks.
Alternate wording: that you keep banging your head against a wall that you know won't budge ;-}.
Known Participant
November 7, 2014
I sometimes marvel that you persevere Rob :*)
areohbee
areohbeeAuthor
Legend
November 6, 2014
Still broken in Lr5.6 (or in any case, I can't figure out how to use it).

Suggestion: either clarify the documentation, fix the feature, or remove..

Excerpt from current doc:
----------------------------------
actionVerb: (string, optional) The localizable label of the action button; default "OK".
actionBinding: (string or table, optional) A unique return value for the action button.