tags:

views:

48

answers:

2

Hi,
I have code that creates video files(with given names in an output folder).I have buttons in my UI that add :

panel.add(video1);
panel.add(video2);
panel.add(video3);
panel.add(video4);

(where video1=new HTML("embed src=path....")) and clear :

panel.clear();

these videos from the UI.The problem is that it works fine for the first time .But if I repeat the actions add->clear->add->clear and so on I just see the quicktime toolbar[i.e. I just see the 4 videos first time and on all subsequent actions I see the toolbar instead of videos].I think this might be due to adding a same file to the panel twice but I remove them from panel in my clear function[infact I delete the videos] .Any ideas/solutions?

onSuccess(){   
    GUI.panel.add(new HTML("embed src=\"Output/Output1.avi\" WIDTH=\"367\"   
        HEIGHT=\"375\" AUTOPLAY=\"false\" TARGET=\"QUICKTIMEPLAYER\"
        PLUGINSPAGE=\"http://www.apple.com/quicktime/\" />"));  
    //So on for video 2,3,4
}

onClear(){   
    GUI.panel.clear();  
    File f1 = new File("Output/Output1.avi");   
    if (f1.exists()) {
        boolean success=f1.delete();
    }  
    //and so on for 2,3,4
} 
A: 

I don't know what is causing the issue, but in the onClear, which I assume is client side code, you're using the File class, since this code is running in the browser as JavaScript there is no file access possible. So the file check should be done on the server side. I guess it might work in development mode, since that runs plain Java (haven't tested it). But you should move that part to the server side.

Hilbrand
Hi Hilbrand ,Thanks for the reply.Yes I am already running the onClear code on the server side.Actually when the clear button is pressed in the UI it makes a RPC and invokes the onClear method in the server.
Manish
A: 

I found the solution .Everything was correct but i was using IE and it did not render properly.I used Mozilla and it worked.

Manish