HI, i am new to GWT, I have similar query. I want to open a file which is place somewhere in server file system (i.e. a directory on server contains some directory and files in it). I have to represent it in tree structure and display the file on click of leaf Node.
I am paused at opening a file on click event. I want to open it in a widget ( every time a new leaf node click on tree a file would be opened opened in same window/widget replacing the old one). could any one tell me what approach i should follow? any link or suggestions are appreciated. thanks in advance. --arun. On Apr 11, 12:54 am, ffs1985 <[email protected]> wrote: > I tried adding a button when the callback success and on click event > of that button, call to window.open(path,"_blank",""). this didn't > work, I think that the thing is that the browser doesn't know how toopenthat > path. The thing I don't understand is why if Iopena new > tab on firefox or I Explorer or Chrome wirks without a problem. > > Maybe another solution is not to call a rpc to download thefileand > instead of that make something like an old servlet that make a call to > download browser. I've trying this thing works since a lot of time and > I still didn't find a solution. > > I hope someone could help me with this, > > Thanks, > Federico > > On Apr 7, 10:13 am, Jason Essington <[email protected]> wrote: > > > O.K. > > > 1) what is pdfLink? is that supposed to be link? > > 2) if you have any kind of Popup blocker, attempting toopena window > > from the callback will fail. if you want toopena window, it has to > > happen as a direct result of a user action (onClick, etc) > > 3) if link is a path to a filesystemfileare you sure it is correct? > > (this is sneaky, but just might work) > > > 4) Technically not causing a problem but, use generics. > > > AsyncCallback<String> cb = new AsyncCallback<String>{ > > public void onSuccess(String result) ... > > > } > > > -jason > > > On Apr 7, 2009, at 5:04 AM,ffs1985wrote: > > > > Hi I'm trying to make a function that let the user download afile > > > from my application and see it. I could copy thefilefrom server to a > > > local root but when I've tried toopenit, does it work on hosted mode > > > but in web mode fails always, no matter what browser I try(IE 7, > > > Firefox and Chrome). > > > My code is the next one: > > > > private void openDocument(String documentName) { > > > final ManagerExportAsync manejador = > > > ManagerExport.Util.getInstance > > > (); > > > AsyncCallback callback = new AsyncCallback(){ > > > String link; > > > public void onSuccess(final Object result) { > > > link = (String)result; > > > Window.open(pdfLink,"_blank",""); > > > } > > > public void onFailure(Throwable caught){} > > > }; > > > > manejador.openDocument("User",userId, documentName,callback); > > > } > > > > The String link result is something like this "file///:C:/test.jpg" > > > I don't know what it's wrong. I read somewhere that the problem could > > > be that I'm calling the Window.openinside the callback but I really > > > don't know what is wrong coul someone give me a hand? > > > > Any suggestions? > > > Thanks! > > > Federico. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
