We have used this before. And can be sure CR should not be the cause of SRC breaking.
Can you just simply “print” the src value to test. Something like:
Hi @sid, it is something I have used many times before too, but for some reason it is just not working. I added your code but also just added some static text so I would know where the values were coming from, like this.
In the browser, the image is missing and the binding inside the condition is empty, however the binding outside the condition is there as it should be.
This is my inspector output
It is strange because I know I have used this type of thing on other projects and it has worked flawlessly, I wonder if something is missing in the head section, like if the dmxFormatter.js is missing and using a formatter like .uppercase() just stops the output completely, although the console is not returning any errors so I do not think so.
Can you remove the img tag and see if the inside condition text renders? It seems something else is wrong here since even if the binding is not working for src, the regular text inside condition should have rendered in HTML.
Or maybe move it above the img tag to see if it renders.
Would you mind testing on your side sid even with php or whatever you are using just to see if it works, and also to see if when adding the condition if some added component gets added to the head maybe.
Are you also seeing that CR does not work when varCR2's value is set to 2?
For a value of 3 and above, and condition > 1 it works fine for me too.
I don't think that is the issue. Since using dmx.parse returns correct value. Its the CR that has some issue.
I just tried dmx-show and that is working as expected.
For CR, I have discovered another thing. On my page, when the condition becomes true, but the focus is still on the button, the CR does not show. As soon as I click outside, it shows up.
Well I managed to cheat it, I am unsure why but if I adjust my code and put the count of the database array into a variable first, and then evaluate if the variable value is greater than 1, it all works as it should have without first adding the variable.
Makes no sense, but it’s working now at least, so thank you for doing yours different so I could test a different way about it.
Looks like a case of dmx update issue.
Can you try this. Revert to your old code. After server action has completed, run this in console manually: dmx.requestUpdate() and see if the image gets rendered.
I would like to make a wild guess this has something to do with the new show/hide events of CR.
But only @patrick would be the guy to tell us what’s actually going on here.
Here’s what I think could be happening…
The value of the variable is using the same server connect as the CR condition. So that is triggering dmxupdate correctly. Hence CR is working.
Maybe set the variable value to some other dynamic component or just static value and see if CR still works?
Quite right, setting it to 1 does not work, but setting it to any other dynamic value then forces the update. I think you may have found the exact bug.