fady005
Posts: 115
|
Posted: 04/13/2007, 12:54 AM |
|
Hello,
I would like to show an image of a product depending on its id... The link to the image is in a database column and not all products have images...
I tryed modifying a label and then insert an image that have the same source but didn't worked...
I also tryed to modify the label to an image to gives me an exception in code...
Can you help me ?
_________________
Be inventive ! |
|
|
matheus
Posts: 386
|
Posted: 04/13/2007, 4:33 AM |
|
Put Label Content HTML.
In Database Column choose the Image column.
In Custom Code put something like this:
e.getControl().setValue("<img src="+e.getControl().getValue()+">");
It works?
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
fady005
Posts: 115
|
Posted: 04/13/2007, 6:13 AM |
|
When you say "Label Content HTML" you mean this :
or this
I think it's the first one because the last one just insert the <label></label> tags in HTML Code.
So I tried putting the code you gave (with a litle modification) on it's Before show event...
e.getControl().setValue("<img src=\""+DBTools.convertToString( DBTools.dLookUp("[lien photo]",
"[m 4 nomenclature nav]", "[cd mat nm]="+e.getPage().getParameter("cd_mat_nm"),
"Connection1"), "Connection1", e.getPage().getCCSLocale())+"\">");
It shows the address as it is in the Html page :
_________________
Be inventive ! |
|
|
matheus
Posts: 386
|
Posted: 04/13/2007, 7:59 AM |
|
Ok, now in Design Mode select this Label, and in Properties put Content: HTML, it will be Content Text.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
fady005
Posts: 115
|
Posted: 04/16/2007, 1:41 AM |
|
I've done as you told me :
but it doesn't change a lot :
_________________
Be inventive ! |
|
|
fady005
Posts: 115
|
Posted: 04/19/2007, 7:17 AM |
|
What I've done is that I added the column that contains the source of the image to the source query of the grid where the image will be shown and then I insert an Image link...
It work pretty good...
_________________
Be inventive ! |
|
|