Hi.
I am using the script that when the user select some value on the drop-down box, a object Text visible (using the "presence")
I am using the event change, but it doesn't work very well. When I select a value, it doesn't change the Text, but if I select another value, it appear the value selected previous.
Why doesn't it Synchronize the value?
Thanks!!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Rafael,
I am not sure if you are using a good event.
mouseExit is a good event to use (particularly when paired with mouseEnter), when changing the visual appearance of an object. For example a button where the caption is underlined on mouseEnter and not underlined on mouseExit.
If you want to change the presence of objects on the form as the user hovers over the dropdown, then mouseEnter/mouseExit should work. However if you want the changes to happen once the user selects an item from the dropdown, I would recommend the exit event.
Here are some examples:
https://acrobat.com/#d=txGF4IAoqmfTKPrLkwybIA
https://acrobat.com/#d=OzNofi-xFxmpXD1MrVU6rA
https://acrobat.com/#d=Hi0ZwVgVB1PWbxc6OJ0z4A
Hope these help,
Niall
Views
Replies
Total Likes
Hi,
The best way I can explain it, is that the change event fires before the selected item is committed to the dropdown object's rawValue.
When scripting in the change event you need to use the xfa.event.newText, instead of .rawValue. You script should work okay then. However you could just move it as it is to the exit event (as the selected item is committed at that stage) and it should work.
Change event - use xfa.event.newText
All other events - use .rawValue
Niall
Views
Replies
Total Likes
Hi Niall.
Thanks for you fast reply.
So, I am developing this following way:
if(this.rawValue == 1){
texto_apresentacaos.presence = "visible";
texto_noticias.presence = "hidden";
texto_comentarios.presence = "hidden";
}
if(this.rawValue == 2){
texto_apresentacaos.presence = "hidden";
texto_noticias.presence = "visible";
texto_comentarios.presence = "hidden";
}
if(this.rawValue == 3){
texto_apresentacaos.presence = "hidden";
texto_noticias.presence = "hidden";
texto_comentarios.presence = "visible";
}
How Can I use your solution? I tryed to change the rawValue to xfa.event.newText, but it didn't work.
Example:
if(this.xfa.event.newText == 1){
texto_apresentacaos.presence = "visible";
texto_noticias.presence = "hidden";
texto_comentarios.presence = "hidden";
}
Sorry If I am doing wrong.
Views
Replies
Total Likes
Hi Rafael,
If you place the script in the exit event and delete all of the script in the change event. The following Javascript in the exit event should work:
// first I would hide all of the objects
texto_apresentacaos.presence = "hidden";
texto_noticias.presence = "hidden";
texto_comentarios.presence = "hidden";
// then I would use an if/else statement
if (this.rawValue == 1)
{
texto_apresentacaos.presence = "visible";
}
else if (this.rawValue == 2)
{
texto_noticias.presence = "visible";
}
else if (this.rawValue == 3)
{
texto_comentarios.presence = "visible";
}
Things to check:
Hope that helps,
Niall
Hey Niall.
Thanks for reply.
Actually I was already sing the propriety "mouseExit". It works very well, but the single problem is that the runtime (change of the propriety presence) isn't immediately however using the event change is immediately.
For my problem really the single way is using the event Mouseexit?
Thanks!
Views
Replies
Total Likes
Hi Rafael,
I am not sure if you are using a good event.
mouseExit is a good event to use (particularly when paired with mouseEnter), when changing the visual appearance of an object. For example a button where the caption is underlined on mouseEnter and not underlined on mouseExit.
If you want to change the presence of objects on the form as the user hovers over the dropdown, then mouseEnter/mouseExit should work. However if you want the changes to happen once the user selects an item from the dropdown, I would recommend the exit event.
Here are some examples:
https://acrobat.com/#d=txGF4IAoqmfTKPrLkwybIA
https://acrobat.com/#d=OzNofi-xFxmpXD1MrVU6rA
https://acrobat.com/#d=Hi0ZwVgVB1PWbxc6OJ0z4A
Hope these help,
Niall
Views
Replies
Total Likes
Hi Niall!
You are excellent!!
Using the exit event works very very well
I don't have words to thank you for all these helps!
Thanks so much Niall!
Have a nice day!
Correct Reply and Helpfull answer!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies