3

We have the ability to add, remove, and re-order items in a field per SDL Live Content(requires login).

Is there a way to get access to multiple fields in a component form from the same Custom URL pop-up?

Edit: removed alternative ideas to make question clearer.

1 Answer 1

3

You should use a similar approach as the one used in the Items Selector available in Tridion World http://www.sdltridionworld.com/community/2011_extensions/itemselector.aspx

1) You will need to register your custom URL popup as a View.

try {
    var op = window.opener;
    if (op && op.Tridion && op.Tridion.Controls && op.Tridion.Controls.Popup) {
        op.Tridion.Controls.Popup.registerView(null, window);
    }
}
catch (e) {
}

2) Access to the Windows.Opener (Component View) fields.

var args = window.dialogArguments;
    if (args) {
        // get current field value
        var value = "";
        var fields = args.getFields();
        if (fields && fields.length > 0) {
            var values = fields[0].getValues();
            if (values && values.length > 0) {
                value = values[0]
            }
        }
}
1
  • Ah, I just mentioned the Item Selector as an example for another question. :-) So this approach would simplify the setup by having the same extension (custom page/pop-up) handle various parameters. We just need to pass these parameters via the query string in each field's custom url (it'd be a small initial setup). Commented Jun 10, 2013 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.