Re: Popup windows & printing
Why not just use CSS to hide everything you don't want to print? media=print and display:none should do the job, just hide everything except the stuff to print. You can do it dynamically in case you need to allow to print various regions of the application. On Oct 28, 3:30 am, Mike Dee wrote: > I really don't like the idea of popping up a new window and then > feeding it HTML. In this case it works nicely because the main page > has HTML in it and the popup simply shows the same HTML but without > the UI. > > However, I can think of situations where there is a celltable with > data and I want to print the celltable contents - in a printer > friendly format. Now, there is no HTML (that could be fed into a > popup). That HTML would have to be created. Remember I want to > leverage the browser's ability to print HTML. > > I guess there are two options: > > 1) Clicking a button (to popup the printer friendly window) would have > to create roughly equivalent HTML (as in the celltable) and feed it > into the popup window. > > OR > > 2) Have the popup window do that logic. This where I was thinking of > using another module. But I'm not sure how to do that. Another idea > is to simply put the logic in a JSP. Then I'd need to check on how > session sharing works between JSP and GWT. > > On Oct 27, 12:19 pm, Mike Dee wrote: > > > > > > > > > Did that. Seems to work. Have to figure out CSS issues. > > > Experimenting now with using separate module. > > > On Oct 27, 6:55 am, Jeffrey Chimene wrote: > > > > On 10/26/2011 9:02 PM, Mike Dee wrote: > > > > > It seems easy topopupa new window, but I'm not sure how to stick the > > > > HTML into it. > > > > That's the purpose of the _target attribute in the element. > > > > > If Window.open would return a reference to the window, > > > > I could see a way to do it. > > > > Create a JSNI routine that creates a window and returns the handle. > > > > > Here is another idea. I can create another module to the GWT app. > > > > It's sole purpose is to handle printing. > > > > Whatever. > > > > Bueno Suerte, > > > jec -- 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.
Re: Popup windows & printing
On 10/27/2011 8:30 PM, Mike Dee wrote: I really don't like the idea of popping up a new window and then feeding it HTML. In this case it works nicely because the main page has HTML in it and the popup simply shows the same HTML but without the UI. However, I can think of situations where there is a celltable with data and I want to print the celltable contents - in a printer friendly format. Now, there is no HTML (that could be fed into a popup). That HTML would have to be created. Remember I want to leverage the browser's ability to print HTML. I guess there are two options: 1) Clicking a button (to popup the printer friendly window) would have to create roughly equivalent HTML (as in the celltable) and feed it into the popup window. OR 2) Have the popup window do that logic. This where I was thinking of using another module. But I'm not sure how to do that. Another idea is to simply put the logic in a JSP. Then I'd need to check on how session sharing works between JSP and GWT. You'll have to decide if you want your report to be the logical equivalent of a "Print Screen" or formatted to the dimensions of a piece of paper. The problem isn't new, I've seen it in multiple reincarnations over the years. The inevitable result is basically your 3rd option. The client sends the appropriate key information to the server which responds with the formatted data. The idea is that the server renders the data in a format that is substantially different from what's displayed on the screen. The server's advantage is that it's in a position to include information (perhaps it augments the session data with other database queries) that is not present on the client. -- 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.
Re: Popup windows & printing
I really don't like the idea of popping up a new window and then feeding it HTML. In this case it works nicely because the main page has HTML in it and the popup simply shows the same HTML but without the UI. However, I can think of situations where there is a celltable with data and I want to print the celltable contents - in a printer friendly format. Now, there is no HTML (that could be fed into a popup). That HTML would have to be created. Remember I want to leverage the browser's ability to print HTML. I guess there are two options: 1) Clicking a button (to popup the printer friendly window) would have to create roughly equivalent HTML (as in the celltable) and feed it into the popup window. OR 2) Have the popup window do that logic. This where I was thinking of using another module. But I'm not sure how to do that. Another idea is to simply put the logic in a JSP. Then I'd need to check on how session sharing works between JSP and GWT. On Oct 27, 12:19 pm, Mike Dee wrote: > Did that. Seems to work. Have to figure out CSS issues. > > Experimenting now with using separate module. > > On Oct 27, 6:55 am, Jeffrey Chimene wrote: > > > > > > > > > On 10/26/2011 9:02 PM, Mike Dee wrote: > > > > It seems easy topopupa new window, but I'm not sure how to stick the > > > HTML into it. > > > That's the purpose of the _target attribute in the element. > > > > If Window.open would return a reference to the window, > > > I could see a way to do it. > > > Create a JSNI routine that creates a window and returns the handle. > > > > Here is another idea. I can create another module to the GWT app. > > > It's sole purpose is to handle printing. > > > Whatever. > > > Bueno Suerte, > > jec -- 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.
Re: Popup windows & printing
Did that. Seems to work. Have to figure out CSS issues. Experimenting now with using separate module. On Oct 27, 6:55 am, Jeffrey Chimene wrote: > On 10/26/2011 9:02 PM, Mike Dee wrote: > > > It seems easy topopupa new window, but I'm not sure how to stick the > > HTML into it. > > That's the purpose of the _target attribute in the element. > > > If Window.open would return a reference to the window, > > I could see a way to do it. > > Create a JSNI routine that creates a window and returns the handle. > > > Here is another idea. I can create another module to the GWT app. > > It's sole purpose is to handle printing. > > Whatever. > > Bueno Suerte, > jec -- 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.
Re: Popup windows & printing
I say that. It is from back in 2007. The later messages indicate users had problems with it. Don't know if it is supported either. On Oct 27, 3:03 am, Fabricio Pizzichillo wrote: > I found this thread, maybe can help > you.http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa... > > regards > > 2011/10/27 Mike Dee > > > > > > > > > It seems easy to popup a new window, but I'm not sure how to stick the > > HTML into it. If Window.open would return a reference to the window, > > I could see a way to do it. > > > Here is another idea. I can create another module to the GWT app. > > It's sole purpose is to handle printing. > > > The GWT app I'm working on is based on Activities and Places. The > > layout is based on a DockLayoutPanel, which contains a bunch of UI > > stuff (that appears when printing and is not wanted). The new module > > will simply contain an HTML panel. > > > So the benefits of a new module are: works in standard GWT environment > > (without much hacking) and allows a different layout from main app. > > > On Oct 26, 9:07 am, Jeff Chimene wrote: > > > On 10/26/2011 08:38 AM, Mike Dee wrote: > > > > > I was thinking about something like that. In the posts about popup > > > > windows this is seen as a negative because it is tricky to setup > > > > communications between the main window and the popup. But there > > > > really is no communication needed in this case. > > > > > Do you see the popup window as a GWT window or just a straight HTML > > > > window? > > > > The latter. This is one of those cases where I think that using GWT to > > > create the child window doesn't get you anything except a "problem > > > solved!" endorphin rush. As I said earlier, the solution can be made > > > arbitrarily complex, so I'm sure that someone will chime in with a > > > reason to implement the popup using GWT methods. > > > > To follow-up on the CSS: I've noticed that when there's a reference to a > > > CSS with media type "print", then FF opens a print dialog automatically. > > > I think Chrome does this too. > > > > > On Oct 26, 7:55 am, Jeffrey Chimene wrote: > > > >> On 10/26/2011 1:02 AM, Mike Dee wrote: > > > > >>> I have an app that creates reports, which are basically HTML. The > > > >>> reports need to be printed and that is what I'm trying to figure out. > > > > >>> I'm porting an older app - that is more of traditional web app. > > > >>> Reports are displayed in a page - with a UI wrapped around them. > > When > > > >>> a user wants to print a report, he clicks a "print" link, which pops > > > >>> up a window with a printer friendly version (no UI elements). He can > > > >>> then selects the browser's print command. Works nicely. > > > > >>> I'm trying to figure out how to do that in GWT. I can display a > > > >>> report. Printing doesn't work well, because it prints all the UI > > > >>> stuff too. > > > > >>> I've looked into separate popup windows. Most of the messages here > > > >>> recommend against doing it. Instead they suggest using a Dialog box. > > > >>> I've tried it and created a Dialog with simply an HTMLPanel. > > However, > > > >>> selecting File->Print (in the browser) prints the entire page (the > > > >>> entire window). > > > > >>> Any suggestions on a way to do this? > > > > >> Here's one idea I've implemented. It's amenable to arbitrary levels of > > > >> complexity. > > > > >> Your UI posts a request to your server on user action (e.g. a button > > > >> click event), and opens the result in a new window: > > > >> > > > >> > > > >> > > > >> > > > > >> Reminder: you should have css for print media. > > > -- > > 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. -- 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.
Re: Popup windows & printing
On 10/26/2011 9:02 PM, Mike Dee wrote: It seems easy to popup a new window, but I'm not sure how to stick the HTML into it. That's the purpose of the _target attribute in the element. If Window.open would return a reference to the window, I could see a way to do it. Create a JSNI routine that creates a window and returns the handle. Here is another idea. I can create another module to the GWT app. It's sole purpose is to handle printing. Whatever. Bueno Suerte, jec -- 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.
Re: Popup windows & printing
I found this thread, maybe can help you. http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/eea48bafbe8eed63?pli=1 regards 2011/10/27 Mike Dee > It seems easy to popup a new window, but I'm not sure how to stick the > HTML into it. If Window.open would return a reference to the window, > I could see a way to do it. > > Here is another idea. I can create another module to the GWT app. > It's sole purpose is to handle printing. > > The GWT app I'm working on is based on Activities and Places. The > layout is based on a DockLayoutPanel, which contains a bunch of UI > stuff (that appears when printing and is not wanted). The new module > will simply contain an HTML panel. > > So the benefits of a new module are: works in standard GWT environment > (without much hacking) and allows a different layout from main app. > > On Oct 26, 9:07 am, Jeff Chimene wrote: > > On 10/26/2011 08:38 AM, Mike Dee wrote: > > > > > I was thinking about something like that. In the posts about popup > > > windows this is seen as a negative because it is tricky to setup > > > communications between the main window and the popup. But there > > > really is no communication needed in this case. > > > > > Do you see the popup window as a GWT window or just a straight HTML > > > window? > > > > The latter. This is one of those cases where I think that using GWT to > > create the child window doesn't get you anything except a "problem > > solved!" endorphin rush. As I said earlier, the solution can be made > > arbitrarily complex, so I'm sure that someone will chime in with a > > reason to implement the popup using GWT methods. > > > > To follow-up on the CSS: I've noticed that when there's a reference to a > > CSS with media type "print", then FF opens a print dialog automatically. > > I think Chrome does this too. > > > > > > > > > > > > > > > > > > > > > On Oct 26, 7:55 am, Jeffrey Chimene wrote: > > >> On 10/26/2011 1:02 AM, Mike Dee wrote: > > > > >>> I have an app that creates reports, which are basically HTML. The > > >>> reports need to be printed and that is what I'm trying to figure out. > > > > >>> I'm porting an older app - that is more of traditional web app. > > >>> Reports are displayed in a page - with a UI wrapped around them. > When > > >>> a user wants to print a report, he clicks a "print" link, which pops > > >>> up a window with a printer friendly version (no UI elements). He can > > >>> then selects the browser's print command. Works nicely. > > > > >>> I'm trying to figure out how to do that in GWT. I can display a > > >>> report. Printing doesn't work well, because it prints all the UI > > >>> stuff too. > > > > >>> I've looked into separate popup windows. Most of the messages here > > >>> recommend against doing it. Instead they suggest using a Dialog box. > > >>> I've tried it and created a Dialog with simply an HTMLPanel. > However, > > >>> selecting File->Print (in the browser) prints the entire page (the > > >>> entire window). > > > > >>> Any suggestions on a way to do this? > > > > >> Here's one idea I've implemented. It's amenable to arbitrary levels of > > >> complexity. > > > > >> Your UI posts a request to your server on user action (e.g. a button > > >> click event), and opens the result in a new window: > > >> > > >> > > >> > > >> > > > > >> Reminder: you should have css for print media. > > -- > 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. > > -- 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.
Re: Popup windows & printing
It seems easy to popup a new window, but I'm not sure how to stick the HTML into it. If Window.open would return a reference to the window, I could see a way to do it. Here is another idea. I can create another module to the GWT app. It's sole purpose is to handle printing. The GWT app I'm working on is based on Activities and Places. The layout is based on a DockLayoutPanel, which contains a bunch of UI stuff (that appears when printing and is not wanted). The new module will simply contain an HTML panel. So the benefits of a new module are: works in standard GWT environment (without much hacking) and allows a different layout from main app. On Oct 26, 9:07 am, Jeff Chimene wrote: > On 10/26/2011 08:38 AM, Mike Dee wrote: > > > I was thinking about something like that. In the posts about popup > > windows this is seen as a negative because it is tricky to setup > > communications between the main window and the popup. But there > > really is no communication needed in this case. > > > Do you see the popup window as a GWT window or just a straight HTML > > window? > > The latter. This is one of those cases where I think that using GWT to > create the child window doesn't get you anything except a "problem > solved!" endorphin rush. As I said earlier, the solution can be made > arbitrarily complex, so I'm sure that someone will chime in with a > reason to implement the popup using GWT methods. > > To follow-up on the CSS: I've noticed that when there's a reference to a > CSS with media type "print", then FF opens a print dialog automatically. > I think Chrome does this too. > > > > > > > > > > > On Oct 26, 7:55 am, Jeffrey Chimene wrote: > >> On 10/26/2011 1:02 AM, Mike Dee wrote: > > >>> I have an app that creates reports, which are basically HTML. The > >>> reports need to be printed and that is what I'm trying to figure out. > > >>> I'm porting an older app - that is more of traditional web app. > >>> Reports are displayed in a page - with a UI wrapped around them. When > >>> a user wants to print a report, he clicks a "print" link, which pops > >>> up a window with a printer friendly version (no UI elements). He can > >>> then selects the browser's print command. Works nicely. > > >>> I'm trying to figure out how to do that in GWT. I can display a > >>> report. Printing doesn't work well, because it prints all the UI > >>> stuff too. > > >>> I've looked into separate popup windows. Most of the messages here > >>> recommend against doing it. Instead they suggest using a Dialog box. > >>> I've tried it and created a Dialog with simply an HTMLPanel. However, > >>> selecting File->Print (in the browser) prints the entire page (the > >>> entire window). > > >>> Any suggestions on a way to do this? > > >> Here's one idea I've implemented. It's amenable to arbitrary levels of > >> complexity. > > >> Your UI posts a request to your server on user action (e.g. a button > >> click event), and opens the result in a new window: > >> > >> > >> > >> > > >> Reminder: you should have css for print media. -- 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.
Re: Popup windows & printing
On 10/26/2011 08:38 AM, Mike Dee wrote: > I was thinking about something like that. In the posts about popup > windows this is seen as a negative because it is tricky to setup > communications between the main window and the popup. But there > really is no communication needed in this case. > > Do you see the popup window as a GWT window or just a straight HTML > window? The latter. This is one of those cases where I think that using GWT to create the child window doesn't get you anything except a "problem solved!" endorphin rush. As I said earlier, the solution can be made arbitrarily complex, so I'm sure that someone will chime in with a reason to implement the popup using GWT methods. To follow-up on the CSS: I've noticed that when there's a reference to a CSS with media type "print", then FF opens a print dialog automatically. I think Chrome does this too. > > On Oct 26, 7:55 am, Jeffrey Chimene wrote: >> On 10/26/2011 1:02 AM, Mike Dee wrote: >> >> >> >> >> >> >> >> >> >>> I have an app that creates reports, which are basically HTML. The >>> reports need to be printed and that is what I'm trying to figure out. >> >>> I'm porting an older app - that is more of traditional web app. >>> Reports are displayed in a page - with a UI wrapped around them. When >>> a user wants to print a report, he clicks a "print" link, which pops >>> up a window with a printer friendly version (no UI elements). He can >>> then selects the browser's print command. Works nicely. >> >>> I'm trying to figure out how to do that in GWT. I can display a >>> report. Printing doesn't work well, because it prints all the UI >>> stuff too. >> >>> I've looked into separate popup windows. Most of the messages here >>> recommend against doing it. Instead they suggest using a Dialog box. >>> I've tried it and created a Dialog with simply an HTMLPanel. However, >>> selecting File->Print (in the browser) prints the entire page (the >>> entire window). >> >>> Any suggestions on a way to do this? >> >> Here's one idea I've implemented. It's amenable to arbitrary levels of >> complexity. >> >> Your UI posts a request to your server on user action (e.g. a button >> click event), and opens the result in a new window: >> >> >> >> >> >> Reminder: you should have css for print media. > -- 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.
Re: Popup windows & printing
I was thinking about something like that. In the posts about popup windows this is seen as a negative because it is tricky to setup communications between the main window and the popup. But there really is no communication needed in this case. Do you see the popup window as a GWT window or just a straight HTML window? On Oct 26, 7:55 am, Jeffrey Chimene wrote: > On 10/26/2011 1:02 AM, Mike Dee wrote: > > > > > > > > > > > I have an app that creates reports, which are basically HTML. The > > reports need to be printed and that is what I'm trying to figure out. > > > I'm porting an older app - that is more of traditional web app. > > Reports are displayed in a page - with a UI wrapped around them. When > > a user wants to print a report, he clicks a "print" link, which pops > > up a window with a printer friendly version (no UI elements). He can > > then selects the browser's print command. Works nicely. > > > I'm trying to figure out how to do that in GWT. I can display a > > report. Printing doesn't work well, because it prints all the UI > > stuff too. > > > I've looked into separate popup windows. Most of the messages here > > recommend against doing it. Instead they suggest using a Dialog box. > > I've tried it and created a Dialog with simply an HTMLPanel. However, > > selecting File->Print (in the browser) prints the entire page (the > > entire window). > > > Any suggestions on a way to do this? > > Here's one idea I've implemented. It's amenable to arbitrary levels of > complexity. > > Your UI posts a request to your server on user action (e.g. a button > click event), and opens the result in a new window: > > > > > > Reminder: you should have css for print media. -- 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.
Re: Popup windows & printing
On 10/26/2011 1:02 AM, Mike Dee wrote: I have an app that creates reports, which are basically HTML. The reports need to be printed and that is what I'm trying to figure out. I'm porting an older app - that is more of traditional web app. Reports are displayed in a page - with a UI wrapped around them. When a user wants to print a report, he clicks a "print" link, which pops up a window with a printer friendly version (no UI elements). He can then selects the browser's print command. Works nicely. I'm trying to figure out how to do that in GWT. I can display a report. Printing doesn't work well, because it prints all the UI stuff too. I've looked into separate popup windows. Most of the messages here recommend against doing it. Instead they suggest using a Dialog box. I've tried it and created a Dialog with simply an HTMLPanel. However, selecting File->Print (in the browser) prints the entire page (the entire window). Any suggestions on a way to do this? Here's one idea I've implemented. It's amenable to arbitrary levels of complexity. Your UI posts a request to your server on user action (e.g. a button click event), and opens the result in a new window: Reminder: you should have css for print media. -- 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.