Nodejs and Conditional regions issue

I tested this too and concur the show is working perfectly.

The focus issue is very weird, just tested it and got the same too.

Yup, if I do that then all works as expected.

1 Like

I would like to make a wild guess this has something to do with the new show/hide events of CR. :sweat_smile:
But only @patrick would be the guy to tell us what’s actually going on here.

1 Like

Agreed, and thanks so much for all the help sid, I just tried something and it worked too, but in my mind it shouldn’t, so this code does not work

<div id="cond_first_section_how_many_images" is="dmx-if" dmx-bind:condition="sc_retrieve_page_contents.data.query_first_section_images.count() > 1">
  <img class="img-fluid" dmx-bind:src="sc_retrieve_page_contents.data.query_first_section_images[0].il_url">
</div>

But if I add a variable that I am not even using at all just above the exact same code, well then it does, so now I am even more confused.

<dmx-value id="varNotUsed" dmx-bind:value="sc_retrieve_page_contents"></dmx-value>
<div id="cond_first_section_how_many_images" is="dmx-if" dmx-bind:condition="sc_retrieve_page_contents.data.query_first_section_images.count() > 1">
  <img class="img-fluid" dmx-bind:src="sc_retrieve_page_contents.data.query_first_section_images[0].il_url">
</div>

As you say this needs to be Patrick’ed

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.

Any other dynamic value also works? I was hoping it should just have worked only when the dynamic value is coming form the the particular SC sc_retrieve_page_contents. If anything else, it should have not triggered updated for CR.
Weird again.

@patrick Did you get a chance to look into this issue?

Do I understand correctly that the content of the conditional region is not updated/rendered after it is being shown. So it does toggle it but the content is not updated with the latest data.

That how it looks like. I hadn’t actually noticed if it was actually loading the HTML in element tab, but looking at your message, that’s exactly what happening.

Before CR becomes true: <div></div>
After CR becomes true: <div>...</div> The dots mean HTML is there, but nothing is shown on the browser.
After loosing focus from the button: The HTML actually renders on the browser window.

When the button looses focus it state changes causing an update, that then updates the conditional region, will see if I can improve that it renders it correctly directly.

2 Likes

I’ve added an extra update request after the conditional region is made visible. Please let me know if that solved the render problem.

dmxAppConnect.zip (22.5 KB)

2 Likes

Thanks Patrick will give it a try, hopefully @sid still has his test file he created when we were doing our testing, that would possibly be the easiest test.

Working great. I also added an alert on SHOW event, and that is invoking correctly too.
The link has updated file.
Thanks Patrick. :slight_smile:

Tested on my use case, also working perfectly now, thank you so much Patrick, and thanks Sid for all the help with this

Fixed in Wappler 3.7.1

This topic was automatically closed after 46 hours. New replies are no longer allowed.