That's a very useful class, it just did what I needed, that's great!
Chris
public static void it(String style, String it) {
it("<it><header>"+style+"</header><body>"+it+"</body></it>");
}
public static void it(String style, String it) {
it("<html><header>"+style+"</header><body>"+it+"</body></
html>");
}
appliciate your greate job !!!
this is my code:
Stampa= new Button("Stampa");
Stampa.addClickListener(new ClickListener(){
public void onClick(Widget arg0) {
Print.it("<link rel='StyleSheet'
type='text/css'
href='widgets.css'>",tableA);
}
});
where tableA is asortable-rocket,with this css:
.rocket-sortableTable {
background-color: white;
}
.rocket-zebraFlexTable-oddRow {
background-color: #CCCCFF;
color: #330000;
}
.rocket-zebraFlexTable-evenRow {
background-color: #FFCCFF;
color: #330000;
}
.rocket-sortableTable-columnHeader {
font-weight: bold;
text-transform: uppercase;
background-color: white;
color: FFFFFF;
}
.rocket-sortableTable-columnHeader-sortable {
cursor: pointer;
}
.rocket-sortableTable-columnHeader-sorted {
cursor: default;
font-weight: bold;
color: #ff0000;
background-color: #bbbbff;
text-transform: uppercase;
}
.rocket-sortableTable-sortedColumn {
cursor: default;
}
.rocket-sortableTable-sortDirectionArrows {
cursor: pointer;
}
??????????
this is a result of system.out.println of my table:
<TABLE class=" rocket-zebraFlexTable rocket-sortableTable"
__eventBits="1" onchange="null" onload="null" onerror="null"><TBODY>
<TR class=" rocket-zebraFlexTable-oddRow rocket-zebraFlexTable-
heading">
<TD>
<TABLE cellSpacing=0 cellPadding=0 __hash="15121283">
<TBODY>
<TR>
<TD style="VERTICAL-ALIGN: top" align=left>
<DIV class="gwt-Label rocket-sortableTable-columnHeader rocket-
sortableTable-columnHeader-sortable" __eventBits="125" onchange="null"
onload="null" onerror="null">Codice Cl.</DIV></TD>
<TD style="VERTICAL-ALIGN: top" align=left><IMG class="gwt-Image
rocket-sortableTable-sortDirectionArrows" height=16 src="./up.gif"
width=18 __eventBits="98429" onchange="null"></TD></TR></TBODY></
TABLE></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<TABLE cellSpacing=0 cellPadding=0 __hash="2136319">
<TBODY>
<TR>
<TD style="VERTICAL-ALIGN: top" align=left>
<DIV class="gwt-Label rocket-sortableTable-columnHeader rocket-
sortableTable-columnHeader-sortable" __eventBits="125" onchange="null"
onload="null" onerror="null">Cognome</DIV></TD>
<TD style="VERTICAL-ALIGN: top" align=left><IMG class="gwt-Image
rocket-sortableTable-sortDirectionArrows" height=16 src="./up.gif"
width=18 __eventBits="98429" onchange="null"></TD></TR></TBODY></
TABLE></TD>
<TD>
<TABLE cellSpacing=0 cellPadding=0 __hash="1874098">
<TBODY>
<TR>
<TD style="VERTICAL-ALIGN: top" align=left>
<DIV class="gwt-Label rocket-sortableTable-columnHeader rocket-
sortableTable-columnHeader-sortable" __eventBits="125" onchange="null"
onload="null" onerror="null">Nome</DIV></TD>
<TD style="VERTICAL-ALIGN: top" align=left><IMG class="gwt-Image
rocket-sortableTable-sortDirectionArrows" height=16 src="./up.gif"
width=18 __eventBits="98429" onchange="null"></TD></TR></TBODY></
TABLE></TD></TR>
<TR class=" rocket-zebraFlexTable-evenRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="17722462">93963</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="32285792">Aristotele</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="18601230">aris</DIV></TD></TR>
<TR class=" rocket-zebraFlexTable-oddRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="19417131">66071</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="19107749">Cira</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="28039371">pierpaolo</DIV></TD></TR>
<TR class=" rocket-zebraFlexTable-evenRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="19277425">86664</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="27655609">Del Piero</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="11834918">alex</DIV></TD></TR>
<TR class=" rocket-zebraFlexTable-oddRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="32349505">1699</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="15669880">Garibaldi </DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="28490946">Giuseppe</DIV></TD></TR>
<TR class=" rocket-zebraFlexTable-evenRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="25595509">44342</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="15907500">Gates</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="29204960">Bill</DIV></TD></TR>
<TR class=" rocket-zebraFlexTable-oddRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="13540318">65630</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="5978200">Maldini</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="13640927">Paolo</DIV></TD></TR>
<TR class=" rocket-zebraFlexTable-evenRow">
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="19188912">1111</DIV></TD>
<TD class=" rocket-sortableTable-sortedColumn">
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="16408949">torino</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="125" onchange="null" onload="null"
onerror="null" __hash="1331989">giovanni</DIV></TD></TR></TBODY></
TABLE>
On Feb 9, 2:32 pm, "Andre Freller" <andre.frel...@gmail.com> wrote:
> Thanks!
I have been working in an application requesting printing features,
and when I found this class I was so happy...
But I encountered a problem when I was trying to print a styled
Widget. I use the Print.it(String style, UIObject obj) passing the
style as the example says ( Print.it("<link rel='StyleSheet'
type='text/css' media='paper' href='/paperStyle.css'>",
RootPanel.get('myId')); ), with no result.
Then I thought it was another problem. I found out a strange <header>
tag in that function, as you will see:
public static void it(String style, String it)
{
it("<html><header>"+style+"</header><body>"+it+"</body></
html>");
}
I tried to change <header> with <head>, with no result again...
I almost give up now....does anybody know anything about this???
Thanks in advance!!!
Thanks for your help, but I can't get it working yet the style thing.
Also, with your code we get the famous message "This script is part of
module...". I have to make a question with the javascript "question =
confirm("Print document?");" in order to make it works.
I don't think there is no one who had printed a Widget with CSS... I
need help! I think it would be very useful for a lot of GWT
developers.
Thank you guys!!