Skip to main content

JSF 2.0 need idea for

3 replies [Last post]
eL_NiTrO
Offline
Joined: 2011-11-19
Points: 0

Hey guys.
Im making a web 100% based on JSF and i found a problem when i want to do this:
My index:

<span class="pln"> </span><span class="pun">-&gt;..&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;<br />
</span>
<span class="pun">-&gt;.......</span>
<span class="pun">xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.......</span>
<span class="pun">xmlns:h=&quot;http://java.sun.com/jsf/html&quot;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.......</span>
<span class="pun">xmlns:f=&quot;http://java.sun.com/jsf/core&quot;&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.....</span>
<span class="pun">&lt;h:head&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;link href=&quot;./resources/css/default.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;link href=&quot;./resources/css/cssLayout.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;title&gt;Parallelized Bioinformatics Algorithms built on Multicore Processors&lt;/title&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.....</span>
<span class="pun">&lt;/h:head&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.....</span>
<span class="pun">&lt;h:body&gt;&lt;!----&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;div id=&quot;top&quot;&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;tr&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">........</span>
<span class="pun">&lt;td&gt;#{controlWeb.getContenido()}&lt;/td&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">........</span>
<span class="pun">&lt;td colspan=&quot;2&quot;&gt;&lt;img src=&quot;img/header.jpg&quot; alt=&quot;Parallelized Bioinformatics Algorithms&quot; /&gt;&lt;/td&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;/tr&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;/div&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;div&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;div id=&quot;left&quot;&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">........</span>
<span class="pun">&lt;ui:decorate template =&quot;cabecera.xhtml&quot;&gt;  &lt;/ui:decorate&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;/div&gt;          <br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;div id=&quot;content&quot; class=&quot;content&quot;&gt; <br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">.......</span>
<span class="pun"> &lt;ui:decorate template =&quot;#{controlWeb.getContenido()}&quot;&gt;  &lt;/ui:decorate&gt;                 <br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;/div&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;/div&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;div id=&quot;bottom&quot;&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span><span class="pun">....</span>
<span class="pun">&lt;ui:decorate template =&quot;/pie.xhtml&quot;&gt;  &lt;/ui:decorate&gt;<br />
</span>
<span class="pun">-&gt;</span><span class="pun">.........</span>
<span class="pun">&lt;/div&gt;        <br />
</span>
<span class="pun">-&gt;</span><span class="pun">.....</span>
<span class="pun">&lt;/h:body&gt;<br />
</span>
<span class="pun">-&gt; </span><span class="pun">&lt;/html&gt;</span>
All zones except one are always the same. The zone (id = content) I want that when you click a link in any parts of the website all links back to the index.xhtml and in that area the name change to the appropiate webpage. My idea was create a ManagedBean with a String and if you click on a link, that link modify somehow the variable of ManagedBean and when the link return to index that will read from the variable and it will change the web.
The problem is i cant use a setter function called #{controlWeb.setContenido("STRING")} because that command is executed in compile time and doesnt work.
I need one solution or another idea for make that please.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
eL_NiTrO
Offline
Joined: 2011-11-19
Points: 0

Anybody? Please help. I can't be the only one that has faced this problem.

bthalmayr
Offline
Joined: 2007-02-27
Points: 0

On 19th of November I replied the following on the mailing list , possibly it' not routed back, as it's done for other lists,to the forum.

I have not checked with JSF 2.0 but can't you use #{controlWeb.contenido} ?

The 'getContenido' and 'setContenido' method will be called by the framework in the different phases ...

If the 'link' has an actionListener it could change the value ...

-Bernhard

eL_NiTrO
Offline
Joined: 2011-11-19
Points: 0

Thank you very much!!

It's works perfectly!