Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the WebDavURL from Tridion Anguilla in the List View

I would like to get the WebDavURL property of an item int he listview using Anguilla for a GUI Extension.

I have the following code but WebDavURL is not returned:

selectedItem = selection.getItems()[0];
var item = $models.getItem(selectedItem);
var webDavUrl = item.getInfo().webDavUrl();
like image 523
robrtc Avatar asked Feb 19 '23 00:02

robrtc


1 Answers

You'll have to actually load the webDavUrl... item.loadWebDavUrl(). You'll have to set an event handler though to notify once the WebDav URL has been loaded as its an asynchronous method. Here's a sample that includes loading and setting an event handler:

var item = $models.getItem(selectedItem),
    webDavUrl = item.getWebDavUrl();

if (!webDavUrl) {
    // WebDavUrl for cached item hasn't been loaded yet, so lets load it.
    $evt.addEventHandler(item, "loadwebdavurl", function (event) {
        webDavUrl = item.getWebDavUrl(); // also could do event.source.getWebDavUrl()
    });
    item.loadWebDavUrl();
}

Hope that helps!

like image 106
Alex Klock Avatar answered Mar 24 '23 09:03

Alex Klock