Domanda

i made an image drag drop widget, it's for page background to dynamically rend BG with drag dropped picture. in my dialog , i have the widget name 'bgimage' question is, how do i retrieve the path from the drag dropped picture, i wanna store the path into a string , so i can use it in to rend page BG here is part of the code:

<% 
    Image image = new Image(resource, "bgimage");
    image.setSelector(".img");

if(image.hasContent()){

%><img class="full-screen-bg" src="<%= image.getIconPath() %>" alt="" /><%


}

%>

that image.getIconPath(), only gives me the null value....so it doesnt work....

È stato utile?

Soluzione

Use Image#getSrc() method:

<img class="full-screen-bg" src="<%= image.getSrc() %>" alt="" />

You don't need to set a custom selector.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top