Expand my Community achievements bar.

Display different images inside the same image field

Avatar

Level 1

Hi guys,

Currently we have a requirement in which we have to place an image and the image on click has to produce another image (a zoom in, for example).

Currently it is doing this using the code below:

Script - click event of the First Image button

var image = StaticImage1.value.image.value; newImage.rawValue = image;

Script - click event of the Second Image button

var image = StaticImage2.value.image.value; newImage.rawValue = image;

However when clicking the second image it will ask for an image to be loaded everytime!!

Is there a way around this image load event? We want the user to be able to click the second image without asking him to load a another image (no event on click).

P.S. Attached is how we did it, and you can see clearly how it asks for an image on click.

Thanks so much and best regards,

Fernando

3 Replies

Avatar

Level 7

The Image Field object is for allowing users to upload images, that's the nature of the object. Would it work for you to simply have the static images hide/unhide based on the button click?

Avatar

Level 1

Djaknow,

I have attached the PDF on which we are working on. The big picture is a map and on the map are 5 invisible buttons. When either of the 5 buttons is clicked a "zoom in" is show of a map area. When we are in one of these "zoomed in" map areas, when the user clicks it, it asks for an image to load and nothing else can be done on the picture.

The workaround we did was placing a "Volver" or "Back" button which reestablishes the image back to the original main map image.

We are trying to eliminate this event that asks the user for an image.

The code implemented is the following:

Button 1 (1st button of the image) There are 5 of these:

Datos.mapa_area.presence = "invisible";

Datos.mapa_area1.presence = "visible";

Back or "Volver" button has the following code:

Datos.mapa_area.presence = "visible";

Datos.mapa_area1.presence = "invisible";

Datos.mapa_area2.presence = "invisible";

Datos.mapa_area3.presence = "invisible";

Datos.mapa_area4.presence = "invisible";

Datos.mapa_area5.presence = "invisible";

Please have a look at the attached pdf averias_pm and let me know your thoughts.

Thanks,

Fernando

Avatar

Level 10

Hi,

If you set the "Datos.mapa_area" field to readOnly, then the user won't be prompted to select a  replacement image when clicked. Here are some examples.

Good luck,

Niall