Focal Point
[CLOSED] Maintain - using an image in an html grid

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1057070595

December 09, 2010, 03:59 PM
jjoyce
[CLOSED] Maintain - using an image in an html grid
On my maintain form, I have an html grid that displays the contents of a stack. The first column is set to content type: ImagePath. The stack column is a computed value that I've set to the path of the image 'c:\\ibi\\apps\\business_associates\\edit.jpg'.

When I run form from within maintain, it works fine. When I call the form from a fex (I'm using an HTMLFORM in the fex that executes MNTCON) the images don't appear, but they don't appear to be quite broken either. The image looks like a generic icon that kind of looks like a polaroid picture I guess. In contrast, If I purposely change the ImagePath to something that doesn't exist, I get the red X that I would expect to see when an image can't load.

I tried tweaking the path in various ways but couldn't find anything that worked. I also added the same image as a 'resource' to the form outside of my grid just to test it and that worked fine. How do I get the image to show in the grid though?

Jen

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
December 09, 2010, 04:11 PM
Waz
Is this all from Developer Studio ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 09, 2010, 04:13 PM
jjoyce
Yes, I am currently running everything in Dev Studio.


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
December 09, 2010, 04:22 PM
Waz
If you right-click, properties on the image, what is the location for each.

I assume the one run directly is 'c:\ibi\apps\business_associates\edit.jpg'.

I am worried that the run from the HTMLFORM requires the image to be available in the webserver, a URL to the image.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 09, 2010, 05:25 PM
jjoyce
When I run from within the Maintain Dev Environment, the properties location is
file:///c://ibi//apps//business_associates//edit.jpg

When I run from the fex, the properties are all listed as unavailable.

quote:
I am worried that the run from the HTMLFORM requires the image to be available in the webserver, a URL to the image.


I thought this myself, but I couldn't quite figure out how to make that happen. I just ran a few experiments and I'm getting somewhwere but now I have a new problem.

I added the images to my WF domain that the fex is running from. I added it to a test html page so that I could see what its URL was then set my imagepath accordingly:
"WFServlet?IBIMR_action=MR_RUN_FEX&IBIMR_sub_action=MR_OTHER_SECTION&IBIMR_fex=app/edit.jpg&IBIMR_domain=business/business.htm"

This is a broken link from MDE, which I would expect, but works when from MRE. HOWEVER, now I'm getting a new error Smiler The maintain program executes a fex as one of its steps to fill a stack. The Img variable is set as a define field in that fex. When the program runs I'm getting the error below which I think is because my URL has & in it and maintain thinks it needs to pass some more parameters.

(FOC03690) Called Proc, BA_SEARCH_PARAGON, wants 0 Output parms but was called w/ 1.

I could get around this by setting img string in the maintain program instead of in the fex, but is there a more friendly way to refer to that same location so I don't have to worry about the &'s? Or a way to make maintain ignore the &'s?


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
December 09, 2010, 06:25 PM
Waz
The new error is related to what the Fex is returning.

Perhaps it is failing and not returning anything.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 10, 2010, 07:46 AM
GamP
When run from DevStudio, the properties display as file c:/ibi/apps/business_associates/edit.jpg
The URL for that file should then be: /approot/business_associates/edit.jpg
By leaving out the server name it should work for every web environment.

Maintain doesn't care about &. It's the fex that fails. You can easily test that by just executing the fex from devstudio, providing some defaults for the variables it needs.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
December 10, 2010, 02:17 PM
jjoyce
Ohhhhh I see. My FEX is trying to evaluate that string as & variables not maintain and thus crashing.

I did try setting the URL as you suggested GamP, and after a few typos and some swearing, it did work in my developement environment. HOWEVER, my dev environment is a single tier and my production environment is split tiered. So I tried deploying this to production and that breaks the url.

I am setting my ImagePath to /approot/business_associates/edit.jpg as you suggested.
When the page runs in prod, it shows the URL as "http://lghibiweb:8080/approot/business_associates/edit.jpg" BUT approot is on my EDASERVE machine NOT my web server as this URL is pointing to. On my webserver, the image currently exists in C:\ibi\WebFOCUS76\basedir\business\app\edit.jpg ... how do I refer to this in a URL? Or I can move it somewhere else, I just don't know what the root directory is.


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
December 10, 2010, 03:57 PM
GamP
Aha, I see the point.
In that case it may be best to define some place that is accessible by the webserver, it doesn't really matter where as long as the webserver can read that location, and store all the needed images in that place. That way you can always define that location as an absolute path within your maintain/table. And it will work from wherever you start the maintain, be it from DevStudio, mre or otherwise.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988