StepInside

Creativity and Inspiration

Entries tagged with "jsf"

Using forceId with facelets

Recently JSF project that I am working on was shifted from JSP to facelets.

It was really easy task, but nevertheless several problems arose during migration. One of them – using forceId with some myfaces components. The problem is that facelets uses JSF component classes as beans, but forceId is not a java property of tomahawk components. Instead it is passed as JSF attribute and this is handled somewhere is JSP tag classes that are not used by facelets. Of course this can be solved by writing custom TagHandler (analogous of JSP Tag class), but it would be too much work – write TagHandler for every myfaces component.

Much easier solution exists – use f:attribute like this:

<t:outputText id="myd" value="#{bean.property}">
  
<f:attribute name="forceId" value="true"/>
</t:outputText>

Posted by ksh on May 22, 2006 | 2 comments | development, java, jsf

Calendar

March 2010
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930310000

Tags

Archives

RSS feeds