I have to display a product image, using mouseover, using a subfile field! Can some one help?
the image is located in our web site, it works when the parameter is not in a subfile.
Here is what I'm trying but I get no Image.
Mouseover:
applyProperty("Image1", "image source","http://my.web.com/images/Picture/" + getObj("subfile").grid.getDataValue(row, 2)+"/bg_img01.jpg");
applyProperty("Image1", "visibility","visible");
Mouse Over, displaying Image using a subfile field as a parameter
-
- New User
- Posts: 2
- Joined: Fri Apr 15, 2016 12:41 pm
- First Name: Gus
- Last Name: Cobos
- Company Name: Mori Lee LLC.
- Phone: 19545912556
- Address 1: 3155 Southwest 10th Street
- City: Deerfield Beach
- State / Province: Florida
- Zip / Postal Code: 33442
- Country: United States
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Mouse Over, displaying Image using a subfile field as a parameter
Have you debugged it to find out why it's not working?
Add a line that says 'debugger;', this will force the JavaScript debugger to stop on that line.
Step through the code and make sure that:
1) Start up the debugger (in the browser's developer tools) and move the mouse over the object.
2) Check if the 'row' variable is provided. (I didn't think that was provided on mouseover events, but I could be wrong?)
3) That getObj("subfile").grid.getDataValue() is providing the value you expect.
4) If all looks well in the JavaScript debugger, then look in the "Network" tab in the developer tools, you should see the URL for the image that it's trying to fetch. Does the URL look correct? When it fails, what is the error code in the network tab, what error messages are there?
Add a line that says 'debugger;', this will force the JavaScript debugger to stop on that line.
Code: Select all
debugger;
applyProperty("Image1", "image source","http://my.web.com/images/Picture/" + getObj("subfile").grid.getDataValue(row, 2)+"/bg_img01.jpg");
applyProperty("Image1", "visibility","visible");
1) Start up the debugger (in the browser's developer tools) and move the mouse over the object.
2) Check if the 'row' variable is provided. (I didn't think that was provided on mouseover events, but I could be wrong?)
3) That getObj("subfile").grid.getDataValue() is providing the value you expect.
4) If all looks well in the JavaScript debugger, then look in the "Network" tab in the developer tools, you should see the URL for the image that it's trying to fetch. Does the URL look correct? When it fails, what is the error code in the network tab, what error messages are there?
-
- New User
- Posts: 2
- Joined: Fri Apr 15, 2016 12:41 pm
- First Name: Gus
- Last Name: Cobos
- Company Name: Mori Lee LLC.
- Phone: 19545912556
- Address 1: 3155 Southwest 10th Street
- City: Deerfield Beach
- State / Province: Florida
- Zip / Postal Code: 33442
- Country: United States
- Contact:
Re: Mouse Over, displaying Image using a subfile field as a parameter
Thanks, but it doesn't help
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: Mouse Over, displaying Image using a subfile field as a parameter
Gus,
When you are in debug, can you figure out why it's not working? Does the 'row' variable have a value in it?
Glenn
When you are in debug, can you figure out why it's not working? Does the 'row' variable have a value in it?
Glenn
-
- New User
- Posts: 15
- Joined: Wed Oct 28, 2015 2:48 pm
- First Name: Colin
- Last Name: McNeill
- Company Name: Profound Logic
- City: Irvine
- State / Province: California
- Country: United States
- Contact:
Re: Mouse Over, displaying Image using a subfile field as a parameter
Gus,
I already sent you an email about this, but other customers may find this information helpful.
The goal of this example is to take the data from the cell value and apply it to the image source of the image. Therefore when you mouse over each individual row, a new picture will be shown for each row.
I’ve got a simple Genie screen with a subfile and a hidden image.
Within the ‘Onrowmouseover’ event for the subfile I have the following JavaScript code:
I have my images in a folder called ‘Mouse’ in the IFS. The image files are named based on the last names of the customers in the subfile. Making sure that this path name is correct is the trickiest part of this example.
I believe within your forums post you used the ‘getDataValue()’ grid method. For Genie development you must use the ‘getCellValue()’ grid method. I’ll include documentation for both grid methods below.
http://www.profoundlogic.com/docs/pages ... Id=7865271
http://www.profoundlogic.com/docs/pages ... Id=4849913
When you’re confident that your image source is correct, you should experience something like this:
I already sent you an email about this, but other customers may find this information helpful.
The goal of this example is to take the data from the cell value and apply it to the image source of the image. Therefore when you mouse over each individual row, a new picture will be shown for each row.
I’ve got a simple Genie screen with a subfile and a hidden image.
Within the ‘Onrowmouseover’ event for the subfile I have the following JavaScript code:
Code: Select all
var value = getObj("subfile").grid.getCellValue(row, 1); // gets the value of the row in the ‘Last Name’ Column of the subfile grid
applyProperty("Image1", "image source", "/Mouse/" + value + ".jpg"); // applies the value to the image source for the picture
applyProperty("Image1", "visibility", "visible"); // makes image visible (the image is initially hidden)
http://www.profoundlogic.com/docs/pages ... Id=7865271
http://www.profoundlogic.com/docs/pages ... Id=4849913
When you’re confident that your image source is correct, you should experience something like this:
Who is online
Users browsing this forum: No registered users and 2 guests