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:
<button type="submit">
<form action="printTheCurrentReport" _target="_blank" method="get">
<!-- Depending on how you manage sessions, you might want a session ID
token in a hidden field -->
</button>
Reminder: you should have css for print media.
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.
--
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
That's the purpose of the _target attribute in the <form> 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
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.