SPA ServerConnect on load


In my single page app, the serverconnect of all the pages are loading in the beginning, is there a way for me to use DMX-bind to add noload=“noload” only when ! isMatch ?



of course you can use conditional noload

dmx-bind:noload=(condition) ? 'noload' : ' '

I had requested a feature for it in the past but still no answer :slight_smile:

Thank you @s.alpaslan but it is generating errors, what is the exact syntax you used?
I have also tried the below unsuccessfully:
dmx-bind:noload="(isMatch) ? " &quot : "&quotnoload"&quot"

please try again with single quotas

example syntax
is_enabled == 0 ? 'NO' : 'YES'

dmx-bind:noload="(xyzvalue == 1) ? 'YES' : 'noload'"

Still not working for me, I tried the below syntax for two conditions 0 and 1 but the serverconnect is always loading:

<dmx-serverconnect id="scid1" url="/dmxConnect/api/xx/xxx.php" dmx-param:param1="value1" dmx-bind:noload="(0) ? 'YES' : 'noload'">

The noload is a boolean attribute, so you can use it like dmx-bind:noload="xyzvalue != 1".

@patrick, Does that mean that the following server connect should not be loading?

<dmx-serverconnect id="scid1" url="/dmxConnect/api/xx/xxx.php" dmx-param:param1="value1" dmx-bind:noload="0">

Because it is actually loading. Is it a bug?

It should be dmx-bind:noload="1", true means noload and false will load.

Actually dmx-noload="1" is not working neither
noload="1" works but not when I add the prefix dmx-bind:

Do you face the same issue @patrick?

It's not dmx-noload, but dmx-bind:noload

Yes dmx-bind:noload="1" is not working that's what I meant sorry for the typo.


Boolean values return True or False so you need to use it like this.

dmx-bind:noload="(viewclient.params.clientid) ? '' : 'noload'"
write your own spa params !

@s.alpaslan can you please try dmx-bind:noload="(1 == 0) ? ‘’ : ‘noload’" on a test file and confirm that the ServerConnect is not loading? Because it is still loading in my case
Thanks in advance

I already use it in many places.

@patrick , @Teodor
yes this is bug.
I already use it in many places. however, when I try now, “dmx-bind” does not work properly.


here with same problem

@patrick will investigate this


onloaded / ready events will be very good to add. When you want to use an external javascript library on the SPA page. Is this feature technically possible on SPA pages?

( its mean when spa page loaded / ready )

1 Like