Skip to main content
areohbee
Legend
Jul 24, 2011 4:09 AM UTC
Released

P: SDK: LrDialogs.presentModalDialog - actionBinding is broken

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 is closed to new replies. Start a new post to keep the conversation going.

6 replies

Participating Frequently
Dec 9, 2014 4:56 PM UTC
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'
}
}
}
Translate
areohbee
areohbeeAuthor
Legend
Dec 9, 2014 1:08 AM UTC
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?).
Translate
Participating Frequently
Dec 8, 2014 11:42 PM UTC
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.
Translate
areohbee
areohbeeAuthor
Legend
Nov 7, 2014 12:33 AM UTC
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 ;-}.
Translate
Known Participant
Nov 7, 2014 12:27 AM UTC
I sometimes marvel that you persevere Rob :*)
Translate
areohbee
areohbeeAuthor
Legend
Nov 6, 2014 8:03 AM UTC
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.
Translate