Change image using nanoflow

0
Hi All!   How can I achieve this using nanoflow:   I have an image - for example an empty circle like radio button - and when I click on it, it will change to Completed System.Image    
asked
3 answers
0

Hi Attila,

    As per my understanding when you click the image of radio button use the ON CLICK action on the image, using nanoflow change the visibility condition that should enable the Completed image.

answered
0

Hi Attila,

 

you could add both elements on the page and use conditional css classes on the elements.

Add a page parameter object that contains a boolean value for each answer. When the user clicks on it, call a nanoflow that changes this boolean value.

 

The conditional css class expression would be something like 

 

if ($myBooleanValue = true) then 'hide-element' else 'show-element';

 

In your css file (could be the main.scss), add the classes

.hide-element {
    display: none;
}


.show-element{
    display: unset; // or maybe display: block
}

 

Not very straight forward, but it should work.

 

Best,

Holger

 

answered
0

You could have two images on your page, and then just use conditional visibility to determine which to show. 

 

https://docs.mendix.com/refguide9/common-widget-properties/#visibility-properties

 

For example, to show the incomplete icon, you could use something like this...

 

$currentObject/myAttribute = empty

 

and for the complete icon, you could do the opposite, so only one would show. For example...

 

$currentObject/myAttribute != empty

 

Tweak the logic of the visibility expressions so they match what you need.

 

I hope this helps,

 

 

answered