Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

I am not getting to use the global variable. Take a look in my form, please.

Avatar

Level 4

Hi.

I am ashamed. I am not able to use a basic function on the LiveCyle: Global Variable / Object.

I have a textfield for the user to put your name. Then the user must to click at the botton. Its name/value should be value for a global variable then I would use this value in all over form.

Look this my example as I would use this value.

https://acrobat.com/#d=k0YlC1MXEdVTh1g2TXAJxw

What's the error? I already tryed to put as global variable, but it doesn't work.

PS: Calling the value using textfield (TextField.rawValue = TextField2.rawValue) , it works very well, but I prefer to use variable

Thanks so much.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi Rafael,

I'm well thanks

I'm not sure if I understand the question, but I think you are asking if it's possible to have a field which displays the value of a global variable (i.e. the "view" you refer to), which is updated automatically via calculation scripts or similar, but not reliant on another event, such as "click"

I believe using a globally bound object is the only way, and you are correct - it is definitely easier.

Please let me know if I haven't understood the question properly

Thanks

Tim

View solution in original post

4 Replies

Avatar

Level 3

Hi Rafael

I had a look - you can't use a calculate event on a variable in a javascript object, only if you use another field.

To set the valor2 value, you could change the button click to:

teste.name = valor1.rawValue;
valor2.rawValue = teste.name;

Note - you could also set use the second line in events from other objects

Hope this helps

Thanks,

Tim

Avatar

Level 4

Hi Tim, how are you?

Your solution it works very well!

But, is there another way to view the value of one variable without to set in event click, for example?

Don't need to be a object Fieldtext, can be also, for example, a object Text.

Because, if I use of the way that you showed me, I think is easier to use a global FieldText, for example.

Thank you a lot.

Avatar

Correct answer by
Level 3

Hi Rafael,

I'm well thanks

I'm not sure if I understand the question, but I think you are asking if it's possible to have a field which displays the value of a global variable (i.e. the "view" you refer to), which is updated automatically via calculation scripts or similar, but not reliant on another event, such as "click"

I believe using a globally bound object is the only way, and you are correct - it is definitely easier.

Please let me know if I haven't understood the question properly

Thanks

Tim

Avatar

Level 4

Hi Tim.

Thanks for your fast reply.

Exactly  this!

It's a pity I have always to set the value of one global variable through one event as click. If it would work with the object text, it would be perfect!!

Thanks a lot of your attetion
Sorry my English. Here in Brazil I am a English Student yet LOL.
have a nice week