<?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>ZX:rishistar programming blocks &#187; JSF</title>
	<atom:link href="http://rishistar.com/zx/tag/jsf/feed/" rel="self" type="application/rss+xml" />
	<link>http://rishistar.com/zx</link>
	<description>Java/Wordpress programming tips and tricks</description>
	<lastBuildDate>Thu, 15 Jul 2010 15:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>VisualWeb JSF: linking form elements to a database (Part I:Displaying)</title>
		<link>http://rishistar.com/zx/2009/07/visualweb-jsf-linking-form-elements-to-a-database/</link>
		<comments>http://rishistar.com/zx/2009/07/visualweb-jsf-linking-form-elements-to-a-database/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 13:33:19 +0000</pubDate>
		<dc:creator>rishi</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[netbeans 6]]></category>

		<guid isPermaLink="false">http://rishistar.com/zx/?p=19</guid>
		<description><![CDATA[One of the advantages of using the VisualWeb JSF framework in Netbeans is that it makes the process of storing user data submitted in a web page form easy to store into a database. The Prep Work The first thing to do is to ensure your database has been setup with the tables required, and [...]]]></description>
			<content:encoded><![CDATA[<p>One of the advantages of using the VisualWeb JSF framework in Netbeans is that it makes the process of storing user data submitted in a web page form easy to store into a database.</p>
<h2>The Prep Work</h2>
<p>The first thing to do is to ensure your database has been setup with the tables required, and a user that can add data to a table has also been created. This is something I will add in a future post at some point.</p>
<p>As a start point you should have the VisualWeb JSF plugin installed to your copy of Netbeans 6 and created a web application that uses the VisualWeb JSF framework.</p>
<p>Two pages need to created for this application. By default there is a &#8216;Page1.jsp&#8217; and supporting files created with the application. <strong>Add a second page</strong> by right clicking on &#8216;Web Pages&#8217; and choose &#8216;New -&gt; Visual Web JSF Page&#8217;. Label this &#8216;Page2.jsp&#8217;.</p>
<p><strong>Create the form on Page 1</strong> by opening up Page1.jsp. Ensure you are in the Design View for the page. The Woodstock pallette contains the item to use. <a href="http://www.netbeans.org/kb/docs/web/intro.html">A full rundown of all the components is available here</a> &#8211; we are going to use the input text field and a submit button.</p>
<h2>Part I</h2>
<p>The first fun thing to do would be to populate an element from your database.</p>
<ul>
<li>In the Services Tab, ensure the database you have chosen is connected.</li>
<li>Drag a listbox over from the Woodstock Basic Panel across to the page. By default it will be filled with &#8216;Item 1, Item 2 and Item3&#8242;, which we want to change to something from a database.</li>
<li>Give it a label in the Appearance section of the Properties window.</li>
<li>In the Services tab, go to the table whose data you want to be included in the list box.</li>
<li>Drag this table into the page.</li>
<li>Right click on the ListBox Item and right click on it. Choose &#8216;Bind To Data&#8217; from the menu that appears.</li>
<li>In the &#8216;Bind To Data Provider&#8217;.</li>
<li>Choose the table and column you wish to display in the table.</li>
<li>Now when you deploy and run the application in your browser the information should appear in the table</li>
</ul>
<h2></h2>
]]></content:encoded>
			<wfw:commentRss>http://rishistar.com/zx/2009/07/visualweb-jsf-linking-form-elements-to-a-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
