Tracing JSF

Hi,

to trace JSF, my favorite tool is FacesTrace. You can find a demo here :

http://www.primefaces.org:8080/prime-showcase/facestrace/createBook.jsf

especially for starters it shows the lifecycle, parameters etc.

you can also use ui:debug. it can be handy in production mode with pressing ctrl+shift+d ( can be changed of course ) which shows score variable and component tree.

Advertisements

Object doesn’t support this property or method datatable

Hi,

if you have “Object doesn’t support this property or method” error when using primefaces datatable in Internet Explorer, it is quite likely that you assign the same name for id and widgetVar for the datatable like:

<p:dataTable id=”documents” widgetVar=”documents”

so if you change one them like widgetVar to “documentsVar” it will be fixed.

Firefox does not have this problem btw.

JSF2.0 passing actions to Composite Components

Hi,

with JSF 2.0, it is very easy to pass actions to composite components. For example if your composite component is like this:

<composite:interface>
<composite:attribute name="action" required="true" method-signature="void action(java.lang.String)"/>
</composite:interface>

<composite:implementation>
<p:commandButton action="#{cc.attrs.action}" value="test me button"/>
</composite:implementation>

then you can use this composite component as :

<custom:testComponent action="#{somePage.testMe('test String')}"/>

as you see, you can pass parameters to the buttons also.

The java side will be as follows btw:

public void testMe(String parameterString){</pre>
System.out.println(parameterString);
 }

easy, huh ?