Discussion

3
Replies
3358
Views
Pavanir6 Member since 2016 103 posts
Amazon
Posted: 2 years ago
Last activity: 2 years 7 months ago

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 Interface Developer Knowledge Share
Share this page LinkedIn