<?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>Brutus - Le Blog de Fabrice Bourqui &#187; JSF</title>
	<atom:link href="https://blog.developpez.com/brutus/pcategory/java/jsf/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/brutus</link>
	<description></description>
	<lastBuildDate>Sat, 06 Apr 2013 02:02:25 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Ajouter dynamiquement des composants avec IceFaces</title>
		<link>https://blog.developpez.com/brutus/p8557/java/ajouter_dynamiquement_des_composants_ave</link>
		<comments>https://blog.developpez.com/brutus/p8557/java/ajouter_dynamiquement_des_composants_ave#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:43:22 +0000</pubDate>
		<dc:creator><![CDATA[fabou3377]]></dc:creator>
				<category><![CDATA[IceFaces]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[1.Introudction Petite démonstration de la création dynamique de composants avec JSF plus précisement Icefaces&#8230; Qui a dit que java c&#8217;était lourd et compliqué? 2. Notre page xhtml, du moins la partie qui nous intéresse &#60;ice:form&#62; &#160; &#60;ice:panelGrid id=&#34;grid&#34; binding=&#34;#{dynamicgrid.containerComponent}&#34; columns=&#34;2&#34;&#62; &#8230; <a href="https://blog.developpez.com/brutus/p8557/java/ajouter_dynamiquement_des_composants_ave">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>1.Introudction</strong></p>
<p>Petite démonstration de la création dynamique de composants avec JSF plus précisement Icefaces&#8230; Qui a dit que java c&rsquo;était lourd et compliqué? <img src="https://blog.developpez.com/brutus/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /></p>
<p><span id="more-35"></span><br />
<strong>2. Notre page xhtml, du moins la partie qui nous intéresse</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;ice:form&gt; <br />
&nbsp; &lt;ice:panelGrid id=&quot;grid&quot; binding=&quot;#{dynamicgrid.containerComponent}&quot; columns=&quot;2&quot;&gt; <br />
&nbsp; &lt;/ice:panelGrid&gt; <br />
&nbsp; &lt;ice:commandButton value=&quot;Add UI Components&quot; action=&quot;#{dynamicgrid.addComponent}&quot; partialSubmit=&quot;true&quot;/&gt; <br />
&lt;/ice:form&gt;</div></div>
<p><strong>3. le backing bean</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">public class DynamicGrid { <br />
&nbsp;<br />
&nbsp; &nbsp; public DynamicGrid(){ <br />
&nbsp; &nbsp; } <br />
&nbsp;<br />
&nbsp;<br />
&nbsp; &nbsp; private HtmlPanelGrid containerComponent; <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp; &nbsp; public void addComponent() { <br />
&nbsp; &nbsp; &nbsp; &nbsp; //clean previous component <br />
&nbsp; &nbsp; &nbsp; &nbsp; containerComponent.getChildren().clear(); <br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; //dynamically add Child Components to Container Component <br />
&nbsp; &nbsp; &nbsp; &nbsp; for (int i=0;i&lt;10;i++) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UIColumn col = new UIColumn(); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HtmlOutputText ot = new HtmlOutputText(); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ot.setValue(&quot;test&quot;); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; col.getChildren().add(ot); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HtmlInputText it = new HtmlInputText(); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it.setValue(&quot;&quot;); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it.setId(&quot;label&quot;); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; col.getChildren().add(it); <br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (containerComponent == null) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; containerComponent = new HtmlPanelGrid(); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; containerComponent.getChildren().add(col); <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp;<br />
&nbsp; &nbsp; } <br />
&nbsp;<br />
&nbsp; &nbsp; public HtmlPanelGrid getContainerComponent() { <br />
&nbsp; &nbsp; &nbsp; &nbsp; return containerComponent; <br />
&nbsp; &nbsp; } <br />
&nbsp;<br />
&nbsp; &nbsp; public void setContainerComponent(HtmlPanelGrid containerComponent) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; this.containerComponent = containerComponent; <br />
&nbsp; &nbsp; } <br />
}</div></div>
<p><strong>4. Et sans oublier le faces-config.xml</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;managed-bean&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;managed-bean-name&gt;dynamicgrid&lt;/managed-bean-name&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;managed-bean-class&gt;ch.devit.dynamic.DynamicGrid&lt;/managed-bean-class&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt; <br />
&lt;/managed-bean&gt;</div></div>
<p><!--more--></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
