The fieldBuilder
you are accessing from that post is for the SchemaBasedFields
. I'm not sure if this is the official way of accessing the metadata fieldBuilder
, but this is what I came up with playing around with it so far.
var tabs = $display.getView().properties.controls.TabControl,
cardCount = tabs.properties.cards.length,
fieldBuilder,
card;
while (cardCount--) {
card = tabs.properties.cards[cardCount];
if (card.getId() === "MetadataTab") {
fieldBuilder = card.properties.controls.fieldBuilder;
}
}
Now you have a fieldBuilder
that represents your metadata fields, and would do the same as you would for the normal fields to grab the control.
fieldsContainer = fieldBuilder.properties.input;
fieldsNode = fieldsContainer.getElement();
$j(fieldsNode).children().each(function (index, elm) {
var cntrl = $j('div.input', elm)[0].control;
console.log('fieldname=' + cntrl.getFieldName());
});
Hope that helps!