1) That's the local copy on the remote server, right? 2) You could always be sneaky :D. I wonder if a Button.click() would bypass the blocker - my guess being now as that would be a flaw in the popup-blocker. One way though would be to do something like in the async callback, display some kind of clickable message on the screen informing the user it's ready - they hit ok, you display the doc, bypassing the adblocker. And you should know, at least with IE & FF, whether or not it's a popup-blocker issue as the information bar should appear. 3). I think he meant can you actually hit the file by entering the address in the browser (not if the string looked OK). 4) Like he said, it's not the issue - just cleaner programming style.
On Wed, Apr 8, 2009 at 12:27 AM, ffs1985 <ffs1...@gmail.com> wrote: > > Hi sorry, here is the thing, inside my application an user could > upload documents. Then in some other time if he wants to see any of > this documents he select it from a table and click on a view button on > the selected row. There the AsyncCallback that I've wrote is called, > this makes a local copy of the file in the machine and returns the > path where this local copy was saved. > So now that i wrote some context, I will try to give more information: > 1) pdfLink is the path were that local copy of the document is saved. > 2) Yes but the thing is that I can't do it outside the callback > because I must be sure that the file is already created and also the > callback is what returns to me that local url where the file is. > Unless I sincronize the asyncronic call but I don't know how to do > that. > 3) I'm sure that the link its correct because just for be sure i test > to show it in an alert message and it's ok. > 4) I will try with generics but I don't think it's the problem because > this should work on previous versions that doesn't support java 5. > > Thanks for the help, any suggestions will be very helpful > Federico. > > On Apr 7, 10:13 am, Jason Essington <jason.essing...@gmail.com> wrote: > > O.K. > > > > 1) what is pdfLink? is that supposed to be link? > > 2) if you have any kind of Popup blocker, attempting to open a window > > from the callback will fail. if you want to open a window, it has to > > happen as a direct result of a user action (onClick, etc) > > 3) if link is a path to a filesystem file are 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 a file > > > from my application and see it. I could copy the file from server to a > > > local root but when I've tried to open it, 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.open inside 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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---