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

P: SDK: LrDialogs.presentModalDialog - actionBinding is broken

LEGEND ,
Jul 23, 2011 Jul 23, 2011

Copy link to clipboard

Copied

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

Views

212

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Enthusiast ,
Nov 06, 2014 Nov 06, 2014

Copy link to clipboard

Copied

I sometimes marvel that you persevere Rob :*)

Votes

Translate

Translate

Report

Report
LEGEND ,
Nov 06, 2014 Nov 06, 2014

Copy link to clipboard

Copied

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 ;-}.

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Dec 08, 2014 Dec 08, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
LEGEND ,
Dec 08, 2014 Dec 08, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Dec 09, 2014 Dec 09, 2014

Copy link to clipboard

Copied

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'
}
}
}

Votes

Translate

Translate

Report

Report