it shouldn't be the expression that is the issue. It works in the designer and appropriately hides the accordion when view.params.apm_id = 1 however in a web browser it does not hide it when view.params.apm_id = 1
Notice how the steam accordion is displaying in the browser when it should be hidden like the designer when apm_id = 1? Also APM # at the top is displaying {view.params.apm_id} thats how I know it is 1
Don't know where your parameters are coming from, but you can throw a label on the view temporarily and double check that the datatype is what you expect it to be (int vs string)
I pass my apm_id parameter through the url like so
and this is the class, which would definitely explain why it doesn't work in a browser. I ASSUMED it would be automatically casted into a number but I was wrong
I haven't figured out exactly what you are trying to do, but parameters are only read when the view first loads. That means that you can't use a view parameter to switch something on and off.
Instead, pass in the tag path as a parameter and create a binding inside the view to control whatever it is you want.
Are there any risks possible when allowing the user to select an arbitrary tag path to read from? Eg, they can manually change the URL to inspect any true/false tag, in theory.
Probably better to have it get only part of the tag path, so you can limit the area to only one folder of tags.
Yes that is why I was using params, I figured out the problem and it was because it was loaded as unicode on perspective because it was a page parameter
Did you try the expression language's type coercion? toInt({view.params.apm_id}) != 1. Should be equivalent to (and faster and lighter weight than) your script transform. (It would remove the need for a transform entirely)
If this is a parameter being passed in via URL I believe all URL parameters are treated as strings.
I would still stick with the Expression transform over Script, as they execute significantly faster. It may not matter much for such a simple expression, but it's a good rule in general.