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

P: SDK: LrDialogs.presentModalDialog - actionBinding is broken

LEGEND ,
Jul 23, 2011 Jul 23, 2011

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???

Bug Fixed
TOPICS
macOS
548
Translate
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
6 Comments
LEGEND ,
Nov 06, 2014 Nov 06, 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.
Translate
Report
Enthusiast ,
Nov 06, 2014 Nov 06, 2014
I sometimes marvel that you persevere Rob :*)
Translate
Report
LEGEND ,
Nov 06, 2014 Nov 06, 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 ;-}.
Translate
Report
Adobe Employee ,
Dec 08, 2014 Dec 08, 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.
Translate
Report
LEGEND ,
Dec 08, 2014 Dec 08, 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?).
Translate
Report
Adobe Employee ,
Dec 09, 2014 Dec 09, 2014
LATEST
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
Report