My question is related to my another question here: SVG using CSS3 animations in GWT
But it is more simple. Is there a way in GWT to call method after a presenter has been fully loaded?
For example lets have a SVG picture in one window (presenter) and text in another window(presenter). A button is there that when clicked it changes text presenter for SVG image presenter and vice versa (calling the go()
method). I need to strip all CSS from svg an reapply it, but it has to be done AFTER the presenter is changed and image loaded. If I do it in the go()
method, it will not work. Currently hacking it with schudleFixedDelay()
, but want something less hacky.
EDIT1: I mean when presenter contents are fully displayed in DOM, then I want to launch some code. It probably doesn't have anything to do with loading SVG image, just displaying it. How to know when everything from the presenter has been displayed and added to the DOM?
EDIT2:
Ok so the scheduleDeferred
function is really what I am looking for. I know this function and use it, but I had more specific problem it seems. The scheduleDeferred
function calls my method to fix the coordinats just fine. But when I was using it before, it did not work because of the method to fix coordinates. It seems, when I call removeAttribute("class")
on SVG element, I cannot setAttribute("class", "classname")
just after that. I had to make a scheduleFixedDelay
there for at least 100ms, or it does not work. Not sure if the delay will work everywhere (mobiles, tablets...), but I don't know why it does not work without the delay. This is probably a solution for me.