On 9/07/2020 00:37, Richard Dijkstra wrote:
Dear all,

I would like to have a state added to a uri. I use ADS for this as follows:

I have extended the class with:

classextends workitemonto_Workitem {
set_state(){
if (this.Budget > 0 && this.ResourcePlanningOK == true){
this.State = '1_OK' ;
        }
else {
this.State = 'NOK2' ;
    }
    }
}
And set focusNode.set_state() on the attribute inferences values
The State attribute is not recalculated when I change the data. What is wrong?

Could you clarify what your expectation is?

Did you assume that this.State will update automatically when this.Budge or this.ResourcePlanningOK change? No, this would not work. You still need to call the function explicitly.

Or are you saying that this.State doesn't change even after calling set_state again (after data changes)?

An alternative design would be to use the code below as a sh:values rules at the State property:

    (focusNode.Budget > 0 && focusNode.ResourcePlanningOK == true) ? '1_OK' : 'NOK2'

Then any request of this.State would be dynamically computed from the expression above, including the Forms, JavaScript and GraphQL queries.

Regards,
Holger


Kind regards, Richard
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/5d76d937-ce91-46ea-a953-ac56b31de87bo%40googlegroups.com <https://groups.google.com/d/msgid/topbraid-users/5d76d937-ce91-46ea-a953-ac56b31de87bo%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "TopBraid 
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/8e8a9c33-7558-9a15-fc3c-1a90bcca0c49%40topquadrant.com.

Reply via email to