<?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>Fan&#039;s blog &#187; AJAX</title>
	<atom:link href="http://fkpwolf.net/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://fkpwolf.net</link>
	<description>无为而无不为</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:15:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>use ajax4jsf</title>
		<link>http://fkpwolf.net/2007/05/03/use-ajax4jsf/</link>
		<comments>http://fkpwolf.net/2007/05/03/use-ajax4jsf/#comments</comments>
		<pubDate>Fri, 04 May 2007 06:28:00 +0000</pubDate>
		<dc:creator>Fan Fan</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http:///2007/05/03/use-ajax4jsf/</guid>
		<description><![CDATA[Ajax4JSF is a framework which inserts AJAX function to JSF. It is easy to transform orginal JSF code to Ajax-able. Ajax4JSF just changed the way of http message.It&#8217;s document is here. It has a simple example. Look at blow code: the reRender property points out whose data in JSF component tree should be return from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jboss.com/jbossajax4jsf/" target="_blank">Ajax4JSF</a> is a framework which inserts AJAX function to JSF. It is easy to transform orginal JSF code to Ajax-able. Ajax4JSF just changed the way of http message.<br />It&#8217;s document is <a href="http://labs.jboss.com/file-access/default/members/jbossajax4jsf/freezone/docs/devguide/index.html" target="_blank">here</a>. It has a simple example. Look at blow code: <?xml:namespace prefix = a4j /><a4j:commandbutton rerender="rep2" value="Link" action="#{Page1.do2}"></p>
<p><?xml:namespace prefix = h /><h:outputtext id="rep2" value="#{RequestBean1.name}" binding="#{Page1.rep2}"><br />the reRender property points out whose data in JSF component tree should be return from server. After JSF engine renders that component, Ajax4JSF then sends response. So this approach didn&#8217;t do harsh to JSF. We can code in JSF bean: <br /><code><br />private HtmlOutputText rep2 = new HtmlOutputText(); <br />...... <br />String style="border-color: rgb(204, 0, 255); backgroun....."; <br />this.rep2.setStyle(style); <br /></code><br />We can see the benefit of JSF component model. But this model don&#8217;t consider the position of the javascript or it is hard to add javascript function. For example, if we want to hightlight the outputText, Should I write a new class extends HtmlOutputText which has a cool appearance? Maybe a Decrtor Pattern is better. No matter which approach we use, we should encapsulate the javascript into JSF component and give user a consistent usage. On the other hand, If we have a JSF component which is not ajax-able but provides hightlight function, we can use it directly in Ajax4JSF. So the problem is the matter of JSF instead of Ajax4JSF.</p>
<p></h:outputtext></a4j:commandbutton><a4j:commandbutton rerender="rep2" value="Link" action="#{Page1.do2}"><h:outputtext id="rep2" value="#{RequestBean1.name}" binding="#{Page1.rep2}"></h:outputtext></a4j:commandbutton></p>
]]></content:encoded>
			<wfw:commentRss>http://fkpwolf.net/2007/05/03/use-ajax4jsf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

