on 02-28-2008 10:52 AM
Hi
I am trying to add a facility to an App to inform users of progress, but I can't get it to work. Here is what I am trying
<javascript>
infoarea.innerText = "Loading..."
myApplet.updateGrid(true)
function myApplet_Updated()
{
infoArea.innerText += "Done"
}
</javascript>
Which I think should
1) Load infoarea with "Loading..."
2) Update the applet
3) Add "Done" to infoarea
What actually happens though is the applet is updated then infoarea is set to "Loading...Done".
The point is that some applets can take quite a while to load, and users being users they get fed up and start clicking things randomly...
Does anyone have a solution?
Thanks
Nick
Hi Nick,
I'm assuming you're running this in IE.
I have played with that quite a lot as well and it seems that while the applet is updating, the browser does not actually re-render/repaint the other page areas. You may have some luck by executing the "Loading..." JS call before calling the update method of the applet, but I found that this isn't always reliable... If you try a different browser (e.g. Firefox), this may actually work!
One work-around which seems to work reliably is the following:
var chartApp = document.getElementById("chartAppletId");
var chartObj = chartApp.getChartObject();
var oldTitle = chartObj.getTitle();
chartObj.setTitle("Loading...");
chartApp.updateChart(true);
chartObj.setTitle(oldTitle);
Good luck,
Sascha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nick,
I was also struggling with the problem that the browser does not render visible changes while it is running javascript. I think the browser is single threaded. I used setTimeout to break the javascript into two pieces. I can't seem to post the code... Argh..
So, the function that runs on the button click, or whatever, do the message to the user, disable buttons, hide content, etc. Last line in function is setTimeout that executes the applet function.
The applet function does the applet control stuff then changes the message, enables buttons, unhides content, etc.
This works great for me.
--Amy Smith
--Haworth
Maybe all of the users would be happy if they had the WebDynpro 'swirlybird' icon to mesmerize them while it was working
In most cases a bit of user training goes a long way, whereas hackaround solutions can get messy and in some cases make the screen perform even worse (trust me - I've seen many a case of this).
I think you can write to status part of your IE, that is the buttom of the window. This will get updated to start with and during, if you have an while or some kind of loop within Javascript.
BR.
Poul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make your query results return faster
If you have excessive script attempting to man-handle the applets as if they were on the server side then it could actually be the application logic that is creating the extra delays.
Regards,
Jeremy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
6 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.