简体   繁体   English

在Application Craft中设置链接属性

[英]Setting the link property in Application Craft

I'm making a web application in Applicationcraft for a school project. 我在Applicationcraft中为一个学校项目制作一个Web应用程序。 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. 这些图像需要附加一个链接,Applicationcraft中的Image小部件对此具有属性,但是我无法确定使用该图像的语法。

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 该文档没有详细介绍如何设置此属性的格式,并且没有收到错误消息,因此我有些困惑

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. 查找属性名称的最佳方法是将鼠标悬停在AC属性栏中的相关属性上,或者使用开发工具使用ac的app.debugProperties()函数进行检查。

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. 从您所说的内容来看,我认为您要查找的属性名称是img ,然后在其中设置要填充的图像的URL。

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 也请查看AC论坛,那里有很多关于createWidget()的帖子也可以提供帮助。请参阅https://getsatisfaction.com/application_craft/searches?query=createwidget&x=0&y=0&style=topics

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM