Thanks Philippe for correcting me.<br>After some modifications the Js code is<br><br><br>printwindowJs<br>&nbsp;&nbsp;&nbsp; ^ &#39;<br>function chkstate(){<br>if(document.readyState==&quot;complete&quot;){window.close()}<br>else{setTimeout(&quot;chkstate()&quot;,2000)}}
<br><br>function print_win(){<br>window.print();chkstate();}<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; function printContent(id){<br>str=document.getElementById(id).innerHTML<br>newwin=window.open(&#39;&#39;&#39;&#39;,&#39;&#39;printwin&#39;&#39;,&#39;&#39;left=100,top=100,width=400,height=400&#39;&#39;)
<br>newwin.document.write(&#39;&#39;&lt;HTML&gt;\n&lt;HEAD&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;TITLE&gt;Print Page&lt;/TITLE&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;/HEAD&gt;\n&#39;&#39;)
<br>newwin.document.write(&#39;&#39;&lt;BODY onload=&quot;print_win()&quot;&gt;\n&#39;&#39;)<br>newwin.document.write(str)<br>newwin.document.write(&#39;&#39;&lt;/BODY&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;/HTML&gt;\n&#39;&#39;)
<br>newwin.document.close()<br>}<br><br>&#39;<br><br><br>Now, I am getting a popup browser with the div rendered in it. But the automatic printerSelection menu is not coming. I hope I am closer than last time.<br><br>Regards,
<br>Rajeev<br><br><div class="gmail_quote">On Jan 2, 2008 11:47 PM, Philippe Marschall &lt;<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/1/2, Rajeev Lochan &lt;<a href="mailto:lochan94@gmail.com">lochan94@gmail.com</a>&gt;:<br><div><div></div><div class="Wj3C7c">&gt; Hi,<br>&gt; One of the hurdles I am facing is printing only a part of the page/ a<br>
&gt; particular html div. By googling, I tried to do the following steps, but<br>&gt; still not able to succeed.<br>&gt;<br>&gt; I followed instruction given in<br>&gt; <a href="http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../scripts/printing.htm" target="_blank">
http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../scripts/printing.htm</a><br>&gt;<br>&gt; 1) created a Javascript printWindow.js &nbsp; with the Js code mentioned there.<br>&gt;<br>&gt; MyLibrary&gt;&gt;printwindowJs
<br>&gt; &nbsp; &nbsp; ^ &#39;&lt;script type=&quot;text/javascript&quot;&gt;<br>&gt; &lt;!--<br>&gt; function printContent(id){<br>&gt; str=document.getElementById(id).innerHTML<br>&gt; newwin=window.open(&#39;&#39;&#39;&#39;,&#39;&#39;printwin&#39;&#39;,&#39;&#39;left=100,top=100,width=400,height=400&#39;&#39;)
<br>&gt; &nbsp;newwin.document.write(&#39;&#39;&lt;HTML&gt;\n&lt;HEAD&gt;\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;&lt;TITLE&gt;Print Page&lt;/TITLE&gt;\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;&lt;script&gt;\n&#39;&#39;)
<br>&gt; &nbsp;newwin.document.write(&#39;&#39;function chkstate(){\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;if(document.readyState==&quot;complete&quot;){\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;window.close
()\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;else{\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;setTimeout(&quot;chkstate()&quot;,2000)\n&#39;&#39;)
<br>&gt; newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;function print_win(){\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;
window.print();\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;chkstate();\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;&lt;\/script&gt;\n&#39;&#39;)<br>
&gt; newwin.document.write(&#39;&#39;&lt;/HEAD&gt;\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;&lt;BODY onload=&quot;print_win()&quot;&gt;\n&#39;&#39;)<br>&gt; newwin.document.write(str)<br>&gt; newwin.document.write
(&#39;&#39;&lt;/BODY&gt;\n&#39;&#39;)<br>&gt; newwin.document.write(&#39;&#39;&lt;/HTML&gt;\n&#39;&#39;)<br>&gt; newwin.document.close()<br>&gt; }<br>&gt; //--&gt;<br>&gt; &lt;/script&gt;&#39;<br><br></div></div>Why do you put &lt;script&gt;-Tags in JavaScript code?
<br><br>Cheers<br>Philippe<br><div><div></div><div class="Wj3C7c"><br>&gt; 2) Added the above Js in #updateRoot: of my rootComponent<br>&gt;<br>&gt; MyRoot&gt;&gt;updateRoot: anHtmlRoot<br>&gt; &nbsp; &nbsp; super updateRoot: anHtmlRoot.
<br>&gt; &nbsp; &nbsp; anHtmlRoot javascript &nbsp;url:<br>&gt; &#39;/seaside/files/ToDoLibrary/printwindow.js&#39;<br>&gt;<br>&gt;<br>&gt; 3) MyRoot&gt;&gt;renderContentOn: html<br>&gt;<br>&gt; html div id: &#39;div1&#39;; with: [ ........... ].
<br>&gt; html div id: &#39;div2&#39;; with: [ ........... ].<br>&gt; html div id: &#39;div3&#39;; with: [ ........... ].<br>&gt; html div id: &#39;div4&#39;; with: [ html text: &#39;Print this Div&#39;.<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html space.
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html html: &#39;&lt;a<br>&gt; href=&quot;#null&quot; onclick=&quot;printContent( &#39; &#39;div4&#39; &#39; );&quot;&gt;Click to print div<br>&gt; 4&lt;/a&gt;&#39;.<br>&gt;<br>&gt; &nbsp; &nbsp; html anchor url: &#39;#&#39;; onClick: &#39;printContent( &#39; &#39;printListView&#39; &#39; )&#39;;
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with: &#39;Print div 4 &#39; .<br>&gt;<br>&gt; I have used both raw html code and modified Seaside/squeak code (I hope its<br>&gt; equivalent). When I click on any of the anchors, nothing happens. I get the
<br>&gt; following error in Firebug(firefox)<br>&gt;<br>&gt; printContent is not defined<br>&gt; onclick (click clientX=0, clientY=0)<br>&gt;<br>&gt;<br>&gt; I crosschecked the inclusion of printwindow.js and it is indeed included in
<br>&gt; the Firebug Js browser.<br>&gt;<br>&gt; I hope you people can help me where I am committing a dumb mistake(maybe) or<br>&gt; is there a better way to print only a div.<br>&gt;<br>&gt; Thanks &amp; Regards,<br>&gt; Rajeev
<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Rajeev Lochan<br>&gt;<br>&gt; Co-founder, AR-CAD.com<br>&gt;<br>&gt; <a href="http://www.ar-cad.com" target="_blank">http://www.ar-cad.com</a><br>&gt; +91 9243468076 (Bangalore)
<br>&gt; 080 65355873<br></div></div>&gt; _______________________________________________<br>&gt; seaside mailing list<br>&gt; <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>&gt;<br>&gt;<br>_______________________________________________
<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Rajeev Lochan<br><br>Co-founder, AR-CAD.com<br><br><a href="http://www.ar-cad.com">http://www.ar-cad.com</a><br>+91 9243468076 (Bangalore)<br>080 65355873