Self reference in expression bindings

Is it possible to self-reference a component in the expression binding on the same component?


Currently, I’m using this:

if(isNull({Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.vrednost}),
	{Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.text},
	case({Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.vrednost},
		0,"ISKLJUČENO",
		1,"NAPRED",
		2,"NAZAD",
		4,"GREŠKA",
		"ISKLJUČENO"
		)
	)

But it’s very time-consuming…
I was also trying like this:

if(isNull({self.vrednost}),
	{self.text},
	case({self.vrednost},
		0,"ISKLJUČENO",
		1,"NAPRED",
		2,"NAZAD",
		4,"GREŠKA",
		"ISKLJUČENO"
		)
	)

Obviously, that doesn’t work, but I almost can’t believe, that expression self-referencing isn’t possible…?

Is all of this data coming from a single UDT instance (hopefully)? If so it might be easier to do it in the UDT.

I do wish that you could self-reference.

No, there is no UDT…
This property ({Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.vrednost}) is binded to a normal tag.

I’m not sure whether you can use the self keyword on a binding like this (I would think you can). But you definitely can’t reference a binding ({Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.text}) in its own definition. A binding replaces the value and therefore can’t reference it.

Give this field a default value, and you shouldn’t get an error anymore:

if(isNull({Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.vrednost}),
	"<Default Value>",
	case({Root Container.ContainerObesalo.lblStatusOkretanjeBubnjeva.vrednost},
		0,"ISKLJUČENO",
		1,"NAPRED",
		2,"NAZAD",
		4,"GREŠKA",
		"ISKLJUČENO"
		)
	)

If that works, then try using the self keyword to see if you can shorten your code.

I don’t get any errors.
My first/current code ({with full property path}) works just fine.
Expression code with {self.text} and {self.vrednost} also doesn’t throw any errors, it just won’t work.

What I mean/need is something like this in SQL query binding: