StepInside

Creativity and Inspiration

May archive

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

January 2009
MoTuWeThFrSaSu
0001234
567891011
12131415161718
19202122232425
2627282930310

Tags

Archives

RSS feeds