Discussion

3
Replies
3611
Views
Pavani r (Pavanir6)
Amazon

Amazon
IN
Pavanir6 Member since 2016 103 posts
Amazon
Posted: March 14, 2018
Last activity: March 15, 2018
Posted: 14 Mar 2018 3:48 EDT
Last activity: 15 Mar 2018 6:12 EDT

how to Display image from a url in a section

Two ways:

1.Use icon control in section. Give a property. Property should be set with url value in activity ot Dt or declareexpression. Performance wise not good if image size is big.

2. Write custom control as below.

<%
ClipboardProperty curProp = tools.getActive();
String UserID=curProp.getStringValue();
String PhotoLink = "https:XXXXXXXXXXXXX/?uid=";
String PhoneToolLink = "https://XXXXXXXXXXXXXXXXXX/users/";

PhotoLink=PhotoLink+UserID;
PhoneToolLink= PhoneToolLink+UserID;

tools.putSaveValue("result",PhotoLink);
tools.putSaveValue("PhonetoolLink",PhoneToolLink);
tools.putSaveValue("UserID",UserID);
%>
<a href="<pega:reference name="$save(PhonetoolLink)"/>" target = "<pega:reference name="$save(UserID)"/>">
<img src="<pega:reference name="$save(result)"/>" alt="Phone tool Icon" style="width:48px;height:64px;">
</a>
<br />
<pega:when test="param.HideUserID=='' || param.HideUserID >= 0">
<pega:reference name="$save(UserID)"/>

</pega:when>

***Edited by Moderator Marissa to update categories***

User Experience Developer Knowledge Share