Hallo Zusammen
Ich versuche gerade eine Dojo Image Gallery in meine DB einzubinden.
Leider funktioniert folgende Code Zeile überhaupt nicht
var fileNames = "#{javascript:@AttachmentNames();}";
Hier bekomme ich überhaupt nichts. Hat jemand den ultimativen Tipp.
Nachstehend den ganzen Code
<xp:eventHandler event="onClientLoad" submit="false">
<xp:this.script><![CDATA[// Build the data store of image urls and make it available with a client-side JS variable
// Build each URL in this format: DB.nsf.nsf/0/docUNID/$File/attachmentname
var fileNames = "#{javascript:@AttachmentNames();}";
// It comes back as a concatenated string, surrounded by square brackets, to parse into an array
fileNames = fileNames.substring(1, fileNames.length-1).split(', ');
var docID = "#{javascript:param.documentId;}";
var itemNameMap = {
imageThumbAttr: "thumb",
imageLargeAttr: "large"
};
// Build an array of image items for the thumbnail's data store
var imageData = {};
imageData.items = [];
for (var i=0; i< fileNames.length; i++) {
var newItem = {};
newItem.thumb = './' + docID + '/$File/' + fileNames;
newItem.large = './' + docID + '/$File/' + fileNames;
newItem.title = 'Image: ' + fileNames;
imageData.items.push(newItem);
}
// Initialize the data store
var imageStore = new dojo.data.ItemFileReadStore({
identifier: 'title',
label: 'Images',
data: imageData
});
var request= {};
// Initialize the Thumbnail Picker
dijit.byId('galleryDisplay').setDataStore(imageStore, request, itemNameMap);
dijit.byId('#{id:galleryDisplay}').setDataStore(imageStore, request, itemNameMap);
]]></xp:this.script>
</xp:eventHandler>
Danke für Eure Hilfe.