cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

javascript events handling

pzorrilla
1-Visitor

javascript events handling

Hello everybody!!

Ok, so I'm facing a problem related with javascript and events handling.
I implemented a progress bar inside a XUI dialog using javascript, what
I'm trying to do now is to show this progress bar once the window was
loaded, first I call my progress_bar() method inside a script when the
"windowload" event is thrown, however I'm supposing that since the
elements have not been loaded I'm not able to see my progress bar,
instead it looks like the Arbortext editor has crashed with a progress
😞 . I'm pretty sure that I need to call the function which is in
charge of start the progress bar since a window's event, but it hasn't
to be the 'windowload' event. Please, can anybody help me? I though also
that it could be a good idea to implement my 'event handling' with ACL,
once my window was created, but I don't know how to call a java script
function using Acl (I mean an specific function).

Please if anybody has any idea of can I solve this issue I would
appreciate your response. As always I'm more than thankful for your time
and support. 🙂

Regards!

Paulette Zorrilla
5 REPLIES 5

Paulette,

I'm not sure what problem you could be seeing; how did you create the progress bar using XUI and javascript? What are you doing on windowload? I don't think the windowload event is fired until the dialog and all of its controls are ready to go.

You can call Javascript from ACL via the js_eval() function or the js "someJavascriptFunction()" command.

FYI, Arbortext 6.1 has a new built-in progress bar dialog and API; check out the release notes<.">http://www.ptc.com/WCMS/files/157567/en/prodrel.pdf>.

Chris
Chris Nitchie
(734) 330-2978
chris.nitchie@oberontech.com<">mailto:chris.nitchie@oberontech.com>
www.oberontech.com

[cid:image001.jpg@01CE6901.A84DFC50]

[cid:image005.png@01CE6903.8131DC70]<">https://twitter.com/oberontech>

[cid:image006.png@01CE6903.8131DC70]<">http://www.linkedin.com/company/oberon-technologies>






Christopher, thank you so much for the reference, however I'm afraid that I'm not able to use the 6.1 version 😞 I implemented my progress bar using a simple for loop and thePackages.java.lang.Thread.sleep() method, all I'm doing is implement this loop inside a function and predefine an initial state and a limit, I print a character inside a label which looks as one element of the progress bar.



Regards!



Paulette Zorrilla

In windowload event I get the current document in order to get the label element and print the character inside it! 🙂 But whe I call my function which starts printing the progress bar, since the windowload event I'm not able to see it.



Paulette Zorrilla

It's difficult to say what's happening without seeing the code, but my guess would be that your Javascript is waiting to update the progress bar when something has happened in Arbortext, but Arbortext is waiting for the Javascript funtion to complete before it does anything. If that's what's happening, everything would appear to stop.


One Javascript solution to this is to use setTimeout. This lets your Javascript finish, but invokes it again later. I don't know if this would work in Arbrotext.

I like the idea of "Arbrotext". Sort of a masculine-oriented version of Arbortext. PTC - get on that!!
Announcements

Top Tags