Manipulate component state values that are not available through event handler

Hey Retool community,

I'd like to allow my users to change the pdf component scaleMode value. How might I go about allowing them to change scaleMode from "width" to "height" and vice-versa? I am able to view what its value is, just not manipulate it (like with an event handler).

Thanks in advance.

Screen Shot 2022-05-18 at 2.31.58 PM

Hello!

Great question! It's actually not possible to control that property with a built-in method. I think the best way to go about it would be to have two PDF components with the same image, but one set to "width" and one "height". One could be hidden and then you could have a button that toggles between them!

Here are some sections on the docs that explain a little bit more about hiding components and manipulating layout:

https://docs.retool.com/docs/hide-or-disable-components-and-queries

https://docs.retool.com/docs/layout#hidden-components

Happy to answer any further questions you might have!

John