0

I'm making a web application in Applicationcraft for a school project. I have to dynamically create a bunch of images (depending on the amount of images in our database). These images need to have a link attached to them, the Image widget in Applicationcraft has a property for this, but I could not find out what the syntax for using this would be.

I currently have this:

for (var i = 0; i < data.length; i++) 
{
    app.createWidget('PanelContainerSponsorLabel', 'WiziCore_UI_LabelWidget', undefined, {name:"HoofdsponsorLabel"+i, pWidth:100, height:50});
    app.createWidget('PanelContainerSponsorLabel', 'WiziCore_UI_LabelWidget', undefined, {name:"fillerLabel"+i, label:"", pWidth:100, height:50});
    app.createWidget('PanelContainerSponsorImage', 'WiziCore_UI_ImgWidget', undefined, {name:"HoofdsponsorImage"+i, pWidth:100, height:50});
    app.createWidget('PanelContainerSponsorImage', 'WiziCore_UI_LabelWidget', undefined, {name:"fillerLabel"+i, label:"", pWidth:100, height:50});
    app.setValue("HoofdsponsorLabel"+i, data[i].BI_SponsorNaam);
    app.setValue("HoofdsponsorImage"+i, data[i].BI_SponsorImage, {link:{type:"url",title:"http:\/\/www.google.nl\/",body:"new_window"}});  //Link to URL here   
}

The documentation doesn't go into specifics about how to format this property and I'm not getting an error message, so I'm kind of stuck

Ageras
  • 3
  • 2

1 Answers1

0

Best way to find the property name is either to hover over the relevant property in the AC properties bar or inspect with your dev tools using ac's app.debugProperties() function.

From what you've said I think the property name you are looking for is img where you'd then set the URL of the image to populate.

Also do check out the AC forum, there have been a number of posts about createWidget() that could help as well See https://getsatisfaction.com/application_craft/searches?query=createwidget&x=0&y=0&style=topics

ijobling
  • 46
  • 1
  • Thank you for your answer, I guess in the end I didn't search hard enough and it was actually right in my face. I managed to find the answer here https://getsatisfaction.com/application_craft/topics/how_to_add_a_url_for_a_image_dynamically. Thank you! – Ageras Jun 14 '14 at 11:48