I can’t make slider-indicators work with conditions

Hi guys,
I’m a newbie and I tried to make something work with conditions.

This is the canvas:

The green box is a slider gallery of 3 slides. As soon as slider-page-2 is visible, I want the indicator (red colored bar underneath) to be changed to state-2.

That’s how I thought it might work:

There are many resources about slider galleries online, but I just want to make it work with conditions to learn it for the future. Thank you for helping me out!

That’s the file:
Slider-indicator.rp (60.1 KB)

1 Like

Hi @gegenwind,

I suggest that you set the action for the bars in the same place as you set for the gallery slides:

You can remove the conditions you have set on “Indicator” DP (Dynamic Panel).

This way the two parts are synchronised. Hope this helps :slight_smile:

1 Like

Thank you, but I knew this simple solution already.

There are many resources about slider galleries online, but I just want to make it work with conditions to learn it for the future. Thank you for helping me out!

I do want to understand, why the conditions won’t work.

Oh, I see…

I think it is stuck because logically it checks the first case (“If state of Gallery equals State1”) an since it is true - it stops there. I guess you could find a way to make this check happen everytime the gallery state changes, may require some change to how the gallery changes are set

You maybe able to find some solutions here

https://uxshape.com/

Its your own website. So you should know if there there was an applicable example. There isn’t. So this reply is plain spam.

I have lots of videos, and I have done some this before. If not there as you wanted, I will send you a new example

I hope this helps you understand just made this video just now, sorry by little boy was making sound in the background slight_smile:

Let me know if you have any other questions

1 Like

Hey

Unfortunately you can’t directly assign the current state of one panel to another panel.
But lately I found a workaround to “link” different panels with the same states.

You can add the name of the current state to a textfield.
And you can assign a state according to a text on a textfield.

Combining these two ideas gives me a nicely linke carousel - tadaa!
Just store the current state of one panel somewhere on a helper textfield.

Slider-indicator.rp (58.4 KB)

@gegenwind

Your provided file doesn’t work because you’ve attached the conditions to the wrong object for the behaviour you’re expecting.

On the dynamic panel named “Indicator” you have conditions attached to the OnLoad event. OnLoad is evaluated once when the object is loaded, and not again unless you explicitly fire OnLoad using a Fire Event action.

In plain terms, your prototype loads and immediately OnLoad is fired for both Gallery and Indicator.

Gallery begins changing states, wrapping from first to last, and Indicator does nothing because its OnLoad looks at the state of Gallery, finds it at State 1 and does nothing because the condition you have says “If Gallery is state 1, make this state 1” - which it already is.

If you want one dynamic panel to react to the state change of another, you’re going to want to use OnPanelStateChanged instead. In your case, to get the behaviour you want, add a Fire Event action to OnPanelStateChanged to call OnLoad on Indicator again.

Slider-indicator.rp (60.4 KB)

1 Like