Does anyone know a solution to return a component tcm to a component link field. There is a solution in the tridion documentation but only to return a value to a text field. Tridion says is possible but they dont provide a clear answer in our ticket. Can anybody please help on that?
-
Can you elaborate on what exactly you are trying to do?– Ant PCommented Jul 28, 2014 at 10:39
-
We have a custom page that convets a page url to uri's. Actually it finds the page in tridion and displays all the component uri's that are on the page. From there we want to return the value of the first component to a component link field– Alexandros BakarosCommented Jul 28, 2014 at 11:08
-
It is a custom pop from a component link field. The only solution that tridion provides is only for text field– Alexandros BakarosCommented Jul 28, 2014 at 11:10
Add a comment
|
1 Answer
I've had a quick play with this on a Component Link field, and it is very easy. All you have to do is pass in the TCM ID as the parameter into setValues function as follows:
var fields = window.dialogArguments.getFields();
if (fields && fields.length > 0) {
fields[0].setValues(["tcm:7-3233"]);
}
This will set the component as the xlink in the Component Link field.