Got it.
MODx.combo.Browser is returning Object data, not only a single filepath or filename.
Using Ext.encode() or Ext.util.JSON.encode(), we get the JSON string. Add another hidden field to resource panel to store this value, then save it to resource::properties when we send back the data to server.
There are no MediaSourceID object, but "relativeUrl" and "fullRelativeUrl" is sufficient.
If we really need MediaSourceID, we can get it by parsing "image" or "thumb" url. At the end of both url, we find
source=1 as MediaSourceID.
{
"name":"favicon.png"
,"cls":"icon-png"
,"url":"images/favicon.png"
,"relativeUrl":"images/favicon.png"
,"fullRelativeUrl":"/images/favicon.png"
,"image":"/connectors/system/phpthumb.php?src=images/favicon.png&w=114&h=114&HTTP_MODAUTH=***SECRET***&f=png&q=90&wctx=mgr&source=1"
,"image_width":114
,"image_height":114
,"thumb":"/connectors/system/phpthumb.php?src=images/favicon.png&w=80&h=60&f=png&q=90&HTTP_MODAUTH=***SECRET***&wctx=mgr&source=1"
,"thumb_width":80
,"thumb_height":60
,"pathname":"PATH_TO_FILE/images/favicon.png"
,"ext":"png"
,"disabled":false
,"size":9035
,"lastmod":"2012-11-08T11:41:11"
,"menu":[{"text":"Delete File", "handler":"this.removeFile"}]
,"shortName":"favicon.png"
,"sizeString":"8.8 KB"
,"dateString":"11/08/2012 11:41 am"
}
[ed. note: lokamaya last edited this post 13 years, 9 months ago.]