<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sheila&#039;s Blog &#187; icefaces</title>
	<atom:link href="http://sheilapollard.com/tag/icefaces/feed/" rel="self" type="application/rss+xml" />
	<link>http://sheilapollard.com</link>
	<description>Software Development</description>
	<lastBuildDate>Wed, 24 Mar 2010 17:19:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuring Icefaces and JBoss Seam Excel</title>
		<link>http://sheilapollard.com/2009/08/20/configuring-icefaces-and-jboss-seam-excel/?utm_campaign=feed&utm_medium=feed&utm_source=blog</link>
		<comments>http://sheilapollard.com/2009/08/20/configuring-icefaces-and-jboss-seam-excel/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 10:14:42 +0000</pubDate>
		<dc:creator>Sheila</dc:creator>
				<category><![CDATA[icefaces]]></category>
		<category><![CDATA[seam]]></category>

		<guid isPermaLink="false">http://sheilapollard.com/?p=463</guid>
		<description><![CDATA[As in Configuring Icefaces and Seam PDF, when you want to render excel pages in an application that already uses seam and icefaces, you need to use the default view handler for rendering the excel files.  So you need to follow some of the same steps&#8230;  Separate out the pages so that some are icefaces [...]]]></description>
			<content:encoded><![CDATA[<p>As in <a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NoZWlsYXBvbGxhcmQuY29tLzIwMDkvMDgvMTcvY29uZmlndXJpbmctaWNlZmFjZXMtYW5kLXNlYW0tcGRmLz91dG1fY2FtcGFpZ249ZmVlZCZ1dG1fbWVkaXVtPWZlZWQmdXRtX3NvdXJjZT1ibG9n">Configuring Icefaces and Seam PDF</a>, when you want to render excel pages in an application that already uses seam and icefaces, you need to use the default view handler for rendering the excel files.  So you need to follow some of the same steps&#8230;  Separate out the pages so that some are icefaces pages only, the other pages are non-icefaces and do the Excel rendering.   Replace icefaces.jar with just-ice.jar and configure the application to delegate pages that contain
<code&gt;&lt;e:workbook/&gt;&lt;/code> to the standard facelets view handler.</p>
<p>Steps:<br />
1.    Update to icefaces 1.8.1 and jboss-seam 2.2.0.GA and test the application still functions correctly.<br />
2.    Replace icefaces.jar with just-ice.jar (from the icefaces jars) and redeploy the application.  Fix any errors.<br />
3.    Add in the excel functionality.  Add jboss-seam-excel-2.2.0.GA.jar and jxl.jar to your ear file.<br />
4.    In components.xml add the excel and document namespaces<code>xmlns:excel="http://jboss.com/products/seam/excel"
xmlns:document="http://jboss.com/products/seam/document"

http://jboss.com/products/seam/document http://jboss.com/products/seam/document-2.2.xsd
http://jboss.com/products/seam/excel http://jboss.com/products/seam/excel-2.2.xsd</code></p>
<p>5.    In faces-config.xml you add both view handlers
<code>&lt;application&gt;
  &lt;view-handler&gt;com.sun.facelets.FaceletViewHandler&lt;/view-handler&gt;
&lt;/application&gt;

&lt;application&gt;
  &lt;view-handler&gt;com.icesoft.faces.facelets.D2DSeamFaceletViewHandler&lt;/view-handler&gt;
  &lt;message-bundle&gt;
    JSFoverride
  &lt;/message-bundle&gt;
&lt;/application&gt;</code></p>
<p>6.    Configure the document servlet in web.xml
<code>&lt;servlet&gt;
  &lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
  &lt;servlet-class&gt;org.jboss.seam.document.DocumentStoreServlet&lt;/servlet-class&gt;
&lt;/servlet&gt;

&lt;servlet-mapping&gt;
  &lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
  &lt;url-pattern&gt;*.csv&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
  &lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
  &lt;url-pattern&gt;*.xls&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</code></p>
<p>and add a new mapping for jsf pages to be handled by the Faces Servlet
<code>&lt;servlet-mapping&gt;
  &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
  &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</code><br />
Your application should now be configured to render excels.  To test this you can copy some of the .xhtml pages from the seam \examples\excel to test that the rendering works.  Take ExcelTest.java and people.xhtml.  Create a normal index page and add a link to people.jsf.
<code>&lt;ice:outputLink value="./docs/people.jsf"&gt;2nd Excel Test/&gt;</code></p>
<p>In people.xhtml I had to edit the value to excelTest.people instead of people
<code>&lt;e:worksheet name="People" value="#{excelTest.people}" var="person"&gt;</code></p>
<p>Now redeploy your application and try accessing people.jsf</p>
<br /><a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NoZWlsYXBvbGxhcmQuY29tLz9wPTQ2MyNjb21tZW50cw==" title=\"Comments on &quot;Configuring Icefaces and JBoss Seam Excel&quot;\"><img src="http://sheilapollard.com/wp-content/plugins/feed-comments-number/image.php?463" alt="Comments" /></a> <img src="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?view=1&post_id=463" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://sheilapollard.com/2009/08/20/configuring-icefaces-and-jboss-seam-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Icefaces and Seam PDF</title>
		<link>http://sheilapollard.com/2009/08/17/configuring-icefaces-and-seam-pdf/?utm_campaign=feed&utm_medium=feed&utm_source=blog</link>
		<comments>http://sheilapollard.com/2009/08/17/configuring-icefaces-and-seam-pdf/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 13:33:44 +0000</pubDate>
		<dc:creator>Sheila</dc:creator>
				<category><![CDATA[icefaces]]></category>
		<category><![CDATA[seam]]></category>

		<guid isPermaLink="false">http://sheilapollard.wordpress.com/?p=455</guid>
		<description><![CDATA[Unfortunately seam-pdf doesn&#8217;t play nice with ICEfaces.  Specifically, the D2DFaceletViewHandler doesn&#8217;t do pdf/email rendering.  The workaround for this is to separate the application into ICEFaces (ice: tags) and Non-ICEFaces (h: tags) pages which are the ones that trigger a pdf or email render.  You can replace icefaces.jar with just-ice.jar, which contains renderers [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately seam-pdf doesn&#8217;t play nice with ICEfaces.  Specifically, the D2DFaceletViewHandler doesn&#8217;t do pdf/email rendering.  The workaround for this is to separate the application into ICEFaces (ice: tags) and Non-ICEFaces (h: tags) pages which are the ones that trigger a pdf or email render.  You can replace icefaces.jar with just-ice.jar, which contains renderers for ICEFaces components only.  Then configure the application to delegate any pages that consist of a
<p:document/> to the standard facelets view handler instead of D2DFaceletViewHandler.</p>
<p><strong>Steps:</strong></p>
<p>1.    I updated to icefaces 1.8.1 and jboss-seam 2.2.0.GA and tested the application still functioned correctly.<br />
2.    Replace icefaces.jar with just-ice.jar (from the icefaces jars) and redeploy the application.  You may get some errors.  For example I found a number of errors caused because an xhtml page contained more than one
<code&gt;&lt;ice:commandButton&gt;&lt;/code> with ids that weren't unique.<br />
3.    If the application is functioning correctly you can start adding in the pdf functionality.  Add itext.jar, itext-rtf.jar, jboss-seam-pdf.jar, jcommon.jar, and jfreechart.jar to your ear file.<br />
4.    In components.xml add the pdf and framework namespaces<code>xmlns:pdf="http://jboss.com/products/seam/pdf" xmlns:core="http://jboss.com/products/seam/core"
xmlns:framework="http://jboss.com/products/seam/framework"</code>
<code>http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.1.xsd
http://jboss.com/products/seam/pdf http://jboss.com/products/seam/pdf-2.1.xsd</code></p>
<p>Also add the following to configure missing pdfs:
<code>&lt;component name="org.jboss.seam.document.documentStore"&gt;
&lt;property name="useExtensions"&gt;true&lt;/property&gt;
&lt;property name="errorPage"&gt;/pdfMissing.seam&lt;/property&gt;
&lt;/component&gt;</code></p>
<p>5.    In faces-config.xml you add both view handlers<br/>
<code&gt;&lt;application>&lt;view-handler&gt;com.sun.facelets.FaceletViewHandler&lt;/view-handler&gt;
&lt;/application&gt;</code>
<code>&lt;application&gt;
&lt;view-handler&gt;com.icesoft.faces.facelets.D2DSeamFaceletViewHandler&lt;/view-handler&gt;
&lt;message-bundle&gt;
JSFoverride
&lt;/message-bundle&gt;
&lt;/application&gt;</code></p>
<p>6.    Configure the document servlet in web.xml
<code>&lt;servlet&gt;
&lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
&lt;servlet-class&gt;org.jboss.seam.document.DocumentStoreServlet&lt;/servlet-class&gt;
&lt;/servlet&gt;</code>
<code>&lt;servlet-mapping&gt;
&lt;servlet-name&gt;Document Store Servlet&lt;/servlet-name&gt;
&lt;url-pattern&gt;*.pdf&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</code></p>
<p>and add a new mapping for jsf pages to be handled by the Faces Servlet
<code>&lt;servlet-mapping&gt;
&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
&lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</code><br />
Your application should now be configured for icefaces pages, and non-icefaces pages that can render pdfs and emails.  To test this you can copy some of the .xhtml pages from seam's \examples\itext to test that the pdf rendering works.  The index.html lists the examples available.  You will need to take lists.xhtml and Lists.java and add them to your application to test that the PDF Lists link in the index works correctly.  Assuming your application has no errors and the PDF List example generates a pdf successfully, you're ready to use seam pdf in your web application.</p>
<br /><a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NoZWlsYXBvbGxhcmQud29yZHByZXNzLmNvbS8/cD00NTUjY29tbWVudHM=" title=\"Comments on &quot;Configuring Icefaces and Seam PDF&quot;\"><img src="http://sheilapollard.com/wp-content/plugins/feed-comments-number/image.php?455" alt="Comments" /></a> <img src="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?view=1&post_id=455" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://sheilapollard.com/2009/08/17/configuring-icefaces-and-seam-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Icefaces link issue in Seam &#8211; missing dataModel</title>
		<link>http://sheilapollard.com/2009/03/09/icefaces-link-issue-in-seam-missing-datamodel/?utm_campaign=feed&utm_medium=feed&utm_source=blog</link>
		<comments>http://sheilapollard.com/2009/03/09/icefaces-link-issue-in-seam-missing-datamodel/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 18:42:50 +0000</pubDate>
		<dc:creator>Sheila</dc:creator>
				<category><![CDATA[icefaces]]></category>
		<category><![CDATA[seam]]></category>

		<guid isPermaLink="false">http://sheilapollard.wordpress.com/?p=17</guid>
		<description><![CDATA[The problem is:
We have a list of objects (we&#8217;ll call them Cars) displayed as results from a search in a seam web application.  This is displayed as rows, iterating through the results to reference thisCar for the current result in each row.  We want to be able to select one of the Cars [...]]]></description>
			<content:encoded><![CDATA[<p>The problem is:<br />
We have a list of objects (we&#8217;ll call them Cars) displayed as results from a search in a seam web application.  This is displayed as rows, iterating through the results to reference thisCar for the current result in each row.  We want to be able to select one of the Cars and open a new window which shows the selected car information, but retains the search results also.  </p>
<p>So the current conversation should be brought through to the new window (to keep the current result set), and then the selected Car should be set (starting a new conversation). The s:link tag maintains the conversation, but currently does not work correctly as it is missing a backing datamodel.  To add that datamodel would require substantial refactoring, adding a lot of extra seam components just to allow the selection to work.</p>
<p>The broken url is http://localhost:8080/app/page.seam?actionMethod=page.xhtml:selectedCar.setCar(thisCar)&amp;cid=3</p>
<p>Without the backing datamodel, the thisCar variable gets passed into the setCar method as null.</p>
<p>A workaround for this is to use a request parameter in the backing bean and a new method that retrieves the list of results and identifies the correct car to select from that.</p>
<p>In the xhtml page use the s:link tag with a parameter set to the current row id:
<code>&lt;s:link id="selectCar" value="#{thisCar.id}" style="color:blue" action="#{selectedCar.setCar()}"&gt;
&lt;f:param name="rowId" value="#{thisCar.id}" /&gt;</code><br />
In the backing bean that row id is a request parameter:
<code>@RequestParameter
private String rowId;</code><br />
Use the rowId to determine the correct car:
<code>public void setCar() {
  int selected = (Integer.parseInt(rowId));&lt;/p&gt;

  Iterator it = results.iterator();
    while (it.hasNext()) {
    Car car= (Car)  it.next();
    if (car.getId() == selected) {
      selectedCar = car;&lt;
  }
}</code><br />
The url is now: http://localhost:8080/app/page.seam?rowId=3&amp;actionMethod=page.xhtml:selectedCar.setCar(selectedCar)&amp;cid=3</p>
<br /><a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NoZWlsYXBvbGxhcmQud29yZHByZXNzLmNvbS8/cD0xNyNjb21tZW50cw==" title=\"Comments on &quot;Icefaces link issue in Seam &#8211; missing dataModel&quot;\"><img src="http://sheilapollard.com/wp-content/plugins/feed-comments-number/image.php?17" alt="Comments" /></a> <img src="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?view=1&post_id=17" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://sheilapollard.com/2009/03/09/icefaces-link-issue-in-seam-missing-datamodel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
