I would like to display an image button (PS_SEND_MAIL_ICN) in a page. When cliked, the button should be able to open outlook with the destination field preset with an email address .
I have done the following:
1. Create an HTML aera field: IMAGE_HTML
2. Added the field in a record : RECORD.IMAGE_HTML
3. Added the record field in a page
4. In the peopleCode page Activate populate the HTML aera:
SQLExec("select CONTNAME from PSCONTDEFN where (contname = 'PS_SEND_MAIL_ICN' and ALTCONTNUM=1)", &emailIconName)
RECORD.IMAGE_HTML.Value = "<a herf='mailto:email_address@.....'><img src='%Image(" | &emailIconName | ")'/></a>"
I am succed to open outlook when clicking on the button but the image cannot be displayed properly. An icon with an X is displayed.
Is there another way to accomplish this?
Note: The image tag is embedded within an anchor tag having a parameter href=mailto:an_email@ddress...
RECORD.IMAGE_HTML.Value = ... a href='an_email@ddress...'><img src='%Image(" | &emailIconName | ")'/>/a.."
did you get this resolved yet?
I faced a similar issue and what i did was,
1. Create an html definition MYHTML with text,
<img src="%Bind(:1)" width="25" height="25" alt="%Bind(:2)" title="%Bind(:2)">
2. Added the peoplecode
XX_CFG_WRK.HTMLAREA.Value = GetHTMLText(HTML.MYHTML, "%Image(" | XX_TYPE_TBL.IMAGE_NAME.Value | ")", XX_TYPE_TBL.DESCR.Value);
Yes it is solved. The problem was due to the fact that the size of the HTMLAREA field in the derrived record was to small and it can't accomade the hole href tag and image output. When I increase it to the max, everything works well as expected.