Changing an image with button onclick

Changing an image with button onclick



I'm totally beginning and have maybe a weird question, please have patience! Thanks.

I created a UI with an image and a button.

Now all I want (for now) is to change the image when pressing the button.

(the images are uploaded and a ButtonOnClick is created, so now what?)


Hi Elck,

How are the images stored? As module resources or in the DB?



Hello Tiago,

Thanks for replying.

I hope this screendump gives you the answer...

As the images are stored as local resources, you have to include all of them inside IF conditions that check a screen variable. Upon clicking on the button, the corresponding screen action must change the value of the variable and refresh the outer IF widget or a container that includes it.

Sorry, I understand what you say, but still have no clue as how to achieve that.

What is, or where do I find definitions of: a screen variable, screen action, refresh...?

Maybe the system is far to high-level for me, I am a simple low-level programmer and would use js to do this like so:

<img id='here'>

<button onclick=document.getElementById('here').src='een' >


Since you are starting with Outsystems, my advice to you is to do the online courses to understand how platform works.

Abílio Matos


Hi Elck Stippen,

To achieve the desired output  stated above, you just have to add some logic and JavaScript. 

Please go through the attached .oml file

Kind Regards,

Benjith Sam


Benjith Sam wrote:

Hi Benjith,

That's exactly what I needed.


Better than watching video's for half an hour and learning what I knew, what I allready understood and mostly what I don't want to know. ;-)

You understand what someone with prior programming experience needs.

Thanks again!