Hello there,
is it possible to write something like this:
${security.user.name == this.bank.CHANGED_UID} && ${p_StatusFrei != this.bank.Status_CFK}
in an expression for data-bind "Disabled" to a button?
It´s described similarly here: Expressions (Angular) - but only for TypeScript code.
It works perfect as long as I do not use a 2nd or 3rd clause in my expression.
Thanks in advance,
Martin
enchev
December 22, 2020, 1:37pm
2
Hi @mkfromhighlands ,
In my opinion the expression should be:
${security.user.name == this.bank.CHANGED_UID && p_StatusFrei != this.bank.Status_CFK}
Thanks again for the superfast answer, youre right - partial expression should be enclosed in ${} - but it doesn
t work either.
Expression works as long as only one partial expression matches, so I suspect there is a problem with the chaining...
korchev
December 22, 2020, 2:28pm
4
How does the generated code look like? A possible workaround is to use a page property set to the desired expression and then use that property to data-bind the Disabled property.
Expression is:
${security.user.name == this.bank.CHANGED_UID || p_StatusFrei != this.bank.Status_CFK}
Generated code looks like this:
....buttonType="button" [disabled]="(security?.user?.name == bank?.CHANGED_UID) || (p_StatusFrei != bank?.Status_CFK)"...
Works fine, thanks.
How would it be possible to get the desired expression into a page property? Do I have to follow a certain syntax or sth?
korchev
December 22, 2020, 3:42pm
6
The exact same syntax should work. Just paste it in the Value textbox when creating the Set property action.