36
Views
1
Comments
block's input parameters changes automatically values when not required ?!
Question

i'm tring to create a custom block to manage textbox.

is defined as TEXT.

from my page i call it and is refered to a INTEGER variable.

when trigger returns value, i check it and if valid, i update my variable.

all fine.

but now i would to add a custom css on block, based on a input variable in block.

now, i change my input variable to change css when not valid.

here, i don't undestand why, but also my input value change and back to previous value saved.

should like a "OnParameterChanged".

on my OML, there are 2 blocks.

1st update the flag to change css, the 2nd not, only update value when ok.

in 1st try to write a number, then insert a letter...


ProvaEmanuele_2.oml
2018-06-08 15-13-30
Ricardo Cebola

I'm afraid the parameters on the screen are still the old ones - so when you change the boolean for the validation you send the old integer that was still valid on the screen as well. Why do you need the validation logic on the screen and not on the block? If you move it down you will not get this issue. I am including an oml with the validation further down and ensuring an integer output from the block as I think was the goal.
Just as a bonus for good practices - if possible avoid setting the style directly as an attribute and go for CSS classes on the style classes. This way you will allow much more flexibility to change the colors to fit in the future.

ProvaEmanuele_Ric.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.