Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2439 Visualizzazioni

Hi everyone!
I have my module and I would like to update a variable dynamically.

This is my XML Code:


<div>
<
t t-if="!identifyBoolean">Loading... </t>
<t t-if="identifyBoolean">Ready! </t>
<
t t-esc="userIdentify()" />
</div>



identifyBoolean is a boolean variable and its first value is false.

userIdentify() is a function that makes an XHTTP request to my server and returns a string.

So, identifyBoolean is true when the XHTTP request is success, but it always is false in template, in JS is true.

On the other hand, userIdentify() seems like it doesn't wait the return.


I don't know what I'm doing wrong. Can you help me, please?

What is the best way to do this?

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 25
3979
0
feb 23
2103
4
mag 25
11627
3
feb 25
13549
1
ago 22
48